Skip to content

Commit

Permalink
JBR-7302 added additional emptiness check in getGlyphOutlineBounds
Browse files Browse the repository at this point in the history
(cherry picked from commit 0794328)
  • Loading branch information
dmitriimorskii authored and vprovodin committed Nov 18, 2024
1 parent 72a8b3b commit 06202b8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1798,9 +1798,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 06202b8

Please sign in to comment.