MCPcopy Create free account
hub / github.com/apache/xmlgraphics-fop / transform

Method transform

fop-core/src/main/java/org/apache/fop/area/CTM.java:230–251  ·  view source on GitHub ↗

Transform a rectangle by the CTM to produce a rectangle in the transformed coordinate system. @param inRect The rectangle in the original coordinate system @return Rectangle2D The rectangle in the transformed coordinate system.

(Rectangle2D inRect)

Source from the content-addressed store, hash-verified

228 * @return Rectangle2D The rectangle in the transformed coordinate system.
229 */
230 public Rectangle2D transform(Rectangle2D inRect) {
231 // Store as 2 sets of 2 points and transform those, then
232 // recalculate the width and height
233 int x1t = (int)(inRect.getX() * a + inRect.getY() * c + e);
234 int y1t = (int)(inRect.getX() * b + inRect.getY() * d + f);
235 int x2t = (int)((inRect.getX() + inRect.getWidth()) * a
236 + (inRect.getY() + inRect.getHeight()) * c + e);
237 int y2t = (int)((inRect.getX() + inRect.getWidth()) * b
238 + (inRect.getY() + inRect.getHeight()) * d + f);
239 // Normalize with x1 < x2
240 if (x1t > x2t) {
241 int tmp = x2t;
242 x2t = x1t;
243 x1t = tmp;
244 }
245 if (y1t > y2t) {
246 int tmp = y2t;
247 y2t = y1t;
248 y1t = tmp;
249 }
250 return new Rectangle(x1t, y1t, x2t - x1t, y2t - y1t);
251 }
252
253 /**
254 * Get string for this transform.

Callers 15

transformPointMethod · 0.95
getDocumentMethod · 0.45
convertFO2PDFMethod · 0.45
convertXML2FOMethod · 0.45
mainMethod · 0.45
convertFO2PDFMethod · 0.45
viewFOMethod · 0.45
convertDOM2PDFMethod · 0.45
printFOMethod · 0.45
convertFO2RTFMethod · 0.45

Calls 4

getWidthMethod · 0.65
getHeightMethod · 0.65
getXMethod · 0.45
getYMethod · 0.45

Tested by 15

testFO2PDFWithJAXPMethod · 0.36
testFO2PSWithJAXPMethod · 0.36
testFO2RTFWithJAXPMethod · 0.36
testFO2Method · 0.36
createAreaTreeMethod · 0.36
saveAreaTreeXMLMethod · 0.36
runTestMethod · 0.36
createIFMethod · 0.36
readDisabledTestcasesMethod · 0.36
foToOutputMethod · 0.36
iFToPDFMethod · 0.36
foToOutputMethod · 0.36