summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/kitfox/svg/RenderableElement.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/com/kitfox/svg/RenderableElement.java b/src/main/java/com/kitfox/svg/RenderableElement.java
index f0fee73..60fac37 100644
--- a/src/main/java/com/kitfox/svg/RenderableElement.java
+++ b/src/main/java/com/kitfox/svg/RenderableElement.java
@@ -141,9 +141,16 @@ abstract public class RenderableElement extends TransformableElement
}
cachedClip = g.getClip();
- Area newClip = new Area(cachedClip);
- newClip.intersect(new Area(clipPath));
- g.setClip(newClip);
+ if (cachedClip == null)
+ {
+ g.setClip(clipPath);
+ }
+ else
+ {
+ Area newClip = new Area(cachedClip);
+ newClip.intersect(new Area(clipPath));
+ g.setClip(newClip);
+ }
}
}