FX - fix bug in measuring text

This commit is contained in:
Jakub Valtar
2015-09-04 11:04:23 -04:00
parent 621d064545
commit 03f2b50f19

View File

@@ -1475,7 +1475,6 @@ public class PGraphicsFX2D extends PGraphics {
}
context.setFont(textFontInfo.font);
fontCache.measuringText.setFont(textFontInfo.font);
}
@@ -1552,6 +1551,7 @@ public class PGraphicsFX2D extends PGraphics {
return super.textWidthImpl(buffer, start, stop);
}
fontCache.measuringText.setFont(textFontInfo.font);
fontCache.measuringText.setText(new String(buffer, start, stop - start));
return (float) fontCache.measuringText.getLayoutBounds().getWidth();
}