poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1885191 - /poi/trunk/src/java/org/apache/poi/sl/draw/PathGradientPaint.java
Date Wed, 06 Jan 2021 09:10:35 GMT
Author: centic
Date: Wed Jan  6 09:10:35 2021
New Revision: 1885191

URL: http://svn.apache.org/viewvc?rev=1885191&view=rev
Log:
Try to avoid error "Start point cannot equalendpoint"

Happened when trying to apply a gradient to an empty text,
let's use at least 1 gradient step always to avoid this.

Modified:
    poi/trunk/src/java/org/apache/poi/sl/draw/PathGradientPaint.java

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/PathGradientPaint.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/PathGradientPaint.java?rev=1885191&r1=1885190&r2=1885191&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/PathGradientPaint.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/PathGradientPaint.java Wed Jan  6 09:10:35 2021
@@ -173,7 +173,9 @@ public class PathGradientPaint implement
                     lower = mid;
                 }
             }
-            return upper;
+
+            // always report at least one gradient step
+            return Math.max(upper, 1);
         }
 
         public WritableRaster createRaster() {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message