pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1614946 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading: AxialShadingContext.java RadialShadingContext.java
Date Thu, 31 Jul 2014 18:06:41 GMT
Author: tilman
Date: Thu Jul 31 18:06:40 2014
New Revision: 1614946

URL: http://svn.apache.org/r1614946
Log:
PDFBOX-1915: intermediate variable must be compared to 0..1 range and not the /Domain range

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java?rev=1614946&r1=1614945&r2=1614946&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
Thu Jul 31 18:06:40 2014
@@ -236,12 +236,12 @@ public class AxialShadingContext impleme
                     inputValue /= denom;
                 }
                 // input value is out of range
-                if (inputValue < domain[0])
+                if (inputValue < 0)
                 {
                     // the shading has to be extended if extend[0] == true
                     if (extend[0])
                     {
-                        inputValue = domain[0];
+                        inputValue = 0;
                     }
                     else
                     {
@@ -256,12 +256,12 @@ public class AxialShadingContext impleme
                     }
                 }
                 // input value is out of range
-                else if (inputValue > domain[1])
+                else if (inputValue > 1)
                 {
                     // the shading has to be extended if extend[1] == true
                     if (extend[1])
                     {
-                        inputValue = domain[1];
+                        inputValue = 1;
                     }
                     else
                     {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java?rev=1614946&r1=1614945&r2=1614946&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java
Thu Jul 31 18:06:40 2014
@@ -274,14 +274,14 @@ public class RadialShadingContext implem
                 else
                 {
                     // choose 1 of the 2 values
-                    if (inputValues[0] >= domain[0] && inputValues[0] <= domain[1])
+                    if (inputValues[0] >= 0 && inputValues[0] <= 1)
                     {
-                        // both values are in the domain -> choose the larger one
-                        if (inputValues[1] >= domain[0] && inputValues[1] <=
domain[1])
+                        // both values are in the range -> choose the larger one
+                        if (inputValues[1] >= 0 && inputValues[1] <= 1)
                         {
                             inputValue = Math.max(inputValues[0], inputValues[1]);
                         }
-                        // first value is in the domain, the second not -> choose first
value
+                        // first value is in the range, the second not -> choose first
value
                         else
                         {
                             inputValue = inputValues[0];
@@ -289,12 +289,13 @@ public class RadialShadingContext implem
                     }
                     else
                     {
-                        // first value is not in the domain, but the second -> choose
second value
-                        if (inputValues[1] >= domain[0] && inputValues[1] <=
domain[1])
+                        // first value is not in the range, 
+                        // but the second -> choose second value
+                        if (inputValues[1] >= 0 && inputValues[1] <= 1)
                         {
                             inputValue = inputValues[1];
                         }
-                        // both are not in the domain
+                        // both are not in the range
                         else
                         {
                             if (extend[0] && extend[1])
@@ -320,12 +321,12 @@ public class RadialShadingContext implem
                         }
                     }
                     // input value is out of range
-                    if (inputValue > domain[1])
+                    if (inputValue > 1)
                     {
                         // the shading has to be extended if extend[1] == true
                         if (extend[1])
                         {
-                            inputValue = domain[1];
+                            inputValue = 1;
                         }
                         else
                         {
@@ -340,12 +341,12 @@ public class RadialShadingContext implem
                         }
                     }
                     // input value is out of range
-                    else if (inputValue < domain[0])
+                    else if (inputValue < 0)
                     {
                         // the shading has to be extended if extend[0] == true
                         if (extend[0])
                         {
-                            inputValue = domain[0];
+                            inputValue = 0;
                         }
                         else
                         {



Mime
View raw message