Skip to content

Commit 2ac2ba2

Browse files
dmitriimorskiijbrbot
authored and
jbrbot
committed
JBR-7302 added additional emptiness check in getGlyphOutlineBounds
1 parent af3639f commit 2ac2ba2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/java.desktop/share/classes/sun/font/StandardGlyphVector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1801,9 +1801,9 @@ Rectangle2D getGlyphOutlineBounds(int glyphID, float x, float y) {
18011801
result = new Rectangle2D.Float();
18021802
result.setRect(strike.getGlyphOutlineBounds(glyphID)); // don't mutate cached rect
18031803
} else {
1804-
if (sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 &&
1804+
final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID);
1805+
if (!rect.isEmpty() && sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 &&
18051806
sgv.invdtx.getScaleX() > 0 && sgv.invdtx.getScaleY() > 0) {
1806-
final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID);
18071807
result = new Rectangle2D.Float(
18081808
(float)(rect.x*sgv.invdtx.getScaleX() + sgv.invdtx.getTranslateX()),
18091809
(float)(rect.y*sgv.invdtx.getScaleY() + sgv.invdtx.getTranslateY()),

0 commit comments

Comments
 (0)