diff options
author | kitfox | 2012-10-03 20:59:41 +0200 |
---|---|---|
committer | kitfox | 2012-10-03 20:59:41 +0200 |
commit | 584ec684cccf3c8735eaef5680fdd154ed6de4ff (patch) | |
tree | 9c836357330a78c0baa6f8db7f997de489b8709f | |
parent | AnimateTransform can now handle short parameter lists. (diff) | |
download | svg-salamander-core-584ec684cccf3c8735eaef5680fdd154ed6de4ff.tar.gz svg-salamander-core-584ec684cccf3c8735eaef5680fdd154ed6de4ff.tar.xz svg-salamander-core-584ec684cccf3c8735eaef5680fdd154ed6de4ff.zip |
Fixing color parsing bug in gradients.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@129 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
-rwxr-xr-x | build.xml | 7 | ||||
-rw-r--r-- | src/main/java/com/kitfox/svg/LinearGradient.java | 11 | ||||
-rw-r--r-- | src/main/java/com/kitfox/svg/Stop.java | 4 |
3 files changed, 13 insertions, 9 deletions
@@ -95,6 +95,7 @@ <target name="-post-jar">
<tstamp/>
+
<jar destfile="${dist.jar}" update="false">
<manifest>
<attribute name="Main-Class" value="com.kitfox.svg.app.SVGPlayer"/>
@@ -121,9 +122,11 @@ </dname>
</genkey>
- <signjar jar="${dist.jar}" alias="${key.user}" storepass="${key.password}" keystore="${key.location}"/>
-
<copy file="${dist.jar}" toFile="${project.www.jar}"/>
+ <signjar jar="${project.www.jar}"
+ alias="${key.user}"
+ storepass="${key.password}"
+ keystore="${key.location}"/>
<delete file="${project.tiny.jar}"/>
<jar destfile="${project.tiny.jar}" update="true">
diff --git a/src/main/java/com/kitfox/svg/LinearGradient.java b/src/main/java/com/kitfox/svg/LinearGradient.java index 81be3d5..ab48052 100644 --- a/src/main/java/com/kitfox/svg/LinearGradient.java +++ b/src/main/java/com/kitfox/svg/LinearGradient.java @@ -132,13 +132,14 @@ public class LinearGradient extends Gradient { viewXform.translate(bounds.getX(), bounds.getY());
//This is a hack to get around shapes that have a width or height of 0. Should be close enough to the true answer.
- double width = bounds.getWidth();
- double height = bounds.getHeight();
- if (width == 0) width = 1;
- if (height == 0) height = 1;
+ double width = Math.max(1, bounds.getWidth());
+ double height = Math.max(1, bounds.getHeight());
viewXform.scale(width, height);
- viewXform.concatenate(gradientTransform);
+ if (gradientTransform != null)
+ {
+ viewXform.concatenate(gradientTransform);
+ }
paint = new com.kitfox.svg.batik.LinearGradientPaint(
pt1,
diff --git a/src/main/java/com/kitfox/svg/Stop.java b/src/main/java/com/kitfox/svg/Stop.java index b3990c6..3cd6145 100644 --- a/src/main/java/com/kitfox/svg/Stop.java +++ b/src/main/java/com/kitfox/svg/Stop.java @@ -104,7 +104,7 @@ public class Stop extends SVGElement { }
}
- if (getPres(sty.setName("stop-color")))
+ if (getStyle(sty.setName("stop-color")))
{
Color newVal = sty.getColorValue();
if (newVal != color)
@@ -114,7 +114,7 @@ public class Stop extends SVGElement { }
}
- if (getPres(sty.setName("stop-opacity")))
+ if (getStyle(sty.setName("stop-opacity")))
{
float newVal = sty.getFloatValue();
if (newVal != opacity)
|