changeset 5190:15579a6ca5b8

Fix RT-28459: Exception in LinearGradient on J2D pipeline when endpoints are coincident Reviewed by: kcr
author flar <James.Graham@oracle.com>
date Tue, 24 Sep 2013 23:34:57 -0700
parents fa7e3cbe1ded
children e5e4a26f2a09
files modules/graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java	Tue Sep 24 14:04:00 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java	Tue Sep 24 23:34:57 2013 -0700
@@ -226,8 +226,11 @@
                     y2 = y + h * y2;
                 }
                 if (x1 == x2 && y1 == y1) {
-                    x1 -= .0001f;
-                    x2 += .0001f;
+                    // Hardware pipelines use an inverse transform of
+                    // all zeros to choose colors when the start and end
+                    // point are the same so that the first color is
+                    // always chosen...
+                    return colors[0];
                 }
                 java.awt.geom.Point2D p1 =
                     new java.awt.geom.Point2D.Float(x1, y1);