You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2021/01/06 09:10:35 UTC
svn commit: r1885191 -
/poi/trunk/src/java/org/apache/poi/sl/draw/PathGradientPaint.java
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