changeset 4015:45f064ac1724

RT-31167: Stroked text not measured correctly on Canvas (breaks effects/etc)
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Wed, 19 Jun 2013 08:45:51 -0700
parents 4db41f2715d3
children b4e20fb245b3
files javafx-sg-prism/src/com/sun/javafx/sg/prism/NGCanvas.java
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGCanvas.java	Wed Jun 19 07:46:29 2013 +0100
+++ b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGCanvas.java	Wed Jun 19 08:45:51 2013 -0700
@@ -1075,13 +1075,14 @@
                     } else {
                         TEMP_TX.translate(x - xAlign, y - yAlign);
                     }
-                    if (token == FILL_TEXT) {
-                        textLayout.getBounds(null, bounds);
-                        TEMP_TX.transform(bounds, bounds);
-                    } else {
+                    textLayout.getBounds(null, bounds);
+                    TEMP_TX.transform(bounds, bounds);
+                    if (token == STROKE_TEXT) {
                         int flag = PrismTextLayout.TYPE_TEXT;
                         Shape textShape = textLayout.getShape(flag, null);
-                        strokebounds(getStroke(), textShape, bounds, TEMP_TX);
+                        RectBounds shapeBounds = new RectBounds();
+                        strokebounds(getStroke(), textShape, shapeBounds, TEMP_TX);
+                        bounds.unionWith(shapeBounds);
                     }
                 }
                 if (gr != null) {