changeset 9578:7cce7ed57d89 jdk-9+107

8088853: Applying dashed border to separator makes whole application hang Fixed calculating infinite gap length.
author arusakov
date Wed, 17 Feb 2016 11:59:38 +0300
parents d27471edd943
children 9e03dec95b50 8beee37346fd
files modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRegion.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRegion.java	Fri Feb 19 23:54:04 2016 +0300
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRegion.java	Wed Feb 17 11:59:38 2016 +0300
@@ -1575,8 +1575,10 @@
                     final double segmentLength = dashLength + gapLength;
                     final double divided = lineLength / segmentLength;
                     final double numSegments = (int) divided;
-                    final double dashCumulative = numSegments * dashLength;
-                    gapLength = (lineLength - dashCumulative) / numSegments;
+                    if (numSegments > 0) {
+                        final double dashCumulative = numSegments * dashLength;
+                        gapLength = (lineLength - dashCumulative) / numSegments;
+                    }
                     array = new double[] {dashLength, gapLength};
                     dashOffset = (float) (dashLength*.6);
                 } else {