Skip to content

Commit

Permalink
JBR-7302 added additional emptiness check in getGlyphOutlineBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriimorskii committed Oct 23, 2024
1 parent fce5ed6 commit 2744e07
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1801,9 +1801,9 @@ Rectangle2D getGlyphOutlineBounds(int glyphID, float x, float y) {
result = new Rectangle2D.Float();
result.setRect(strike.getGlyphOutlineBounds(glyphID)); // don't mutate cached rect
} else {
if (sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 &&
final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID);
if (!rect.isEmpty() && sgv.invdtx.getShearX() == 0 && sgv.invdtx.getShearY() == 0 &&
sgv.invdtx.getScaleX() > 0 && sgv.invdtx.getScaleY() > 0) {
final Rectangle2D.Float rect = strike.getGlyphOutlineBounds(glyphID);
result = new Rectangle2D.Float(
(float)(rect.x*sgv.invdtx.getScaleX() + sgv.invdtx.getTranslateX()),
(float)(rect.y*sgv.invdtx.getScaleY() + sgv.invdtx.getTranslateY()),
Expand Down

0 comments on commit 2744e07

Please sign in to comment.