changeset 5625:939e768ae868

RT-32275: Using '-fx-border-image-repeat: repeat' with '-fx-border-image-slice: 100% fill;' produces a chain of exceptions Reviewed-by: Jim Graham
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Mon, 04 Nov 2013 09:51:02 -0800
parents 76c7f1bbfbd3
children 1194b215f671
files modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRegion.java
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRegion.java	Mon Nov 04 14:56:09 2013 +0100
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRegion.java	Mon Nov 04 09:51:02 2013 -0800
@@ -1348,16 +1348,11 @@
                        0, 0, rightWidth, bottomWidth);
             // paint the center slice
             if (ib.isFilled()) {
-                // we will get gaps if we don't round to pixel boundaries
-                final int areaX = leftInset + leftWidth;
-                final int areaY = topInset + topWidth;
-                final int areaW = Math.round(width) - rightInset - rightWidth - areaX;
-                final int areaH = Math.round(height) - bottomInset - bottomWidth - areaY;
                 // handle no repeat as stretch
                 final float imgW = (ib.getRepeatX() == BorderRepeat.STRETCH) ? centerW : centerSliceWidth;
                 final float imgH = (ib.getRepeatY() == BorderRepeat.STRETCH) ? centerH : centerSliceHeight;
                 paintTiles(g, prismImage, ib.getRepeatX(), ib.getRepeatY(), Side.LEFT, Side.TOP,
-                           areaX, areaY, areaW, areaH,
+                           centerMinX, centerMinY, centerW, centerH,
                            leftSlice, topSlice, centerSliceWidth, centerSliceHeight,
                            0, 0, imgW, imgH);
             }
@@ -1792,7 +1787,7 @@
     {
         // If the destination width/height is 0 or the src width / height is 0 then we have
         // nothing to draw, so we can just bail.
-        if (regionWidth == 0 || regionHeight == 0 || srcW == 0 || srcH == 0) return;
+        if (regionWidth <= 0 || regionHeight <= 0 || srcW <= 0 || srcH <= 0) return;
 
         // At this point we should have real values for the image source coordinates
         assert srcX >= 0 && srcY >= 0 && srcW > 0 && srcH > 0;