diff --git a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGRegion.java b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGRegion.java --- a/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGRegion.java +++ b/javafx-sg-prism/src/com/sun/javafx/sg/prism/NGRegion.java @@ -973,7 +973,7 @@ 0, 0, leftWidth, topWidth); // tile bounds // paint top slice float tileWidth = (ib.getRepeatX() == BorderRepeat.STRETCH) ? - centerW : (centerSliceWidth * topWidth) / topSlice; + centerW : (topSlice > 0 ? (centerSliceWidth * topWidth) / topSlice : 0); float tileHeight = topWidth; paintTiles( g, img, ib.getRepeatX(), BorderRepeat.STRETCH, Side.LEFT, Side.TOP, @@ -988,7 +988,7 @@ // paint left slice tileWidth = leftWidth; tileHeight = (ib.getRepeatY() == BorderRepeat.STRETCH) ? - centerH : (leftWidth * centerSliceHeight) / leftSlice; + centerH : (leftSlice > 0 ? (leftWidth * centerSliceHeight) / leftSlice : 0); paintTiles(g, img, BorderRepeat.STRETCH, ib.getRepeatY(), Side.LEFT, Side.TOP, leftInset, centerMinY, leftWidth, centerH, 0, topSlice, leftSlice, centerSliceHeight, @@ -996,7 +996,7 @@ // paint right slice tileWidth = rightWidth; tileHeight = (ib.getRepeatY() == BorderRepeat.STRETCH) ? - centerH : (rightWidth * centerSliceHeight) / rightSlice; + centerH : (rightSlice > 0 ? (rightWidth * centerSliceHeight) / rightSlice : 0); paintTiles(g, img, BorderRepeat.STRETCH, ib.getRepeatY(), Side.LEFT, Side.TOP, centerMaxX, centerMinY, rightWidth, centerH, img.getWidth() - rightSlice, topSlice, rightSlice, centerSliceHeight, @@ -1008,7 +1008,7 @@ 0, 0, leftWidth, bottomWidth); // paint bottom slice tileWidth = (ib.getRepeatX() == BorderRepeat.STRETCH) ? - centerW : (centerSliceWidth * bottomWidth) / bottomSlice; + centerW : (bottomSlice > 0 ? (centerSliceWidth * bottomWidth) / bottomSlice : 0); tileHeight = bottomWidth; paintTiles(g, img, ib.getRepeatX(), BorderRepeat.STRETCH, Side.LEFT, Side.TOP, centerMinX, centerMaxY, centerW, bottomWidth,