MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / scaleText

Method scaleText

ij/src/main/java/ij/plugin/RoiScaler.java:144–153  ·  view source on GitHub ↗
(TextRoi roi, double xscale, double yscale, boolean centered)

Source from the content-addressed store, hash-verified

142 }
143
144 private static Roi scaleText(TextRoi roi, double xscale, double yscale, boolean centered) {
145 Rectangle bounds = roi.getBounds();
146 int x = (int)Math.round(bounds.x*xscale);
147 int y = (int)Math.round(bounds.y*yscale);
148 Font font = roi.getCurrentFont();
149 font = font.deriveFont((float)(font.getSize()*yscale));
150 Roi roi2 = new TextRoi(x, y, roi.getText(), font);
151 roi2.copyAttributes(roi);
152 return roi2;
153 }
154
155 private static Roi scaleImage(ImageRoi roi, double xscale, double yscale, boolean centered) {
156 roi = (ImageRoi)roi.clone();

Callers 1

scaleMethod · 0.95

Calls 6

getBoundsMethod · 0.65
getSizeMethod · 0.65
roundMethod · 0.45
getCurrentFontMethod · 0.45
getTextMethod · 0.45
copyAttributesMethod · 0.45

Tested by

no test coverage detected