diff options
author | kitfox | 2012-04-03 01:10:58 +0200 |
---|---|---|
committer | kitfox | 2012-04-03 01:10:58 +0200 |
commit | 67a0a3be84ffbf18fa7ea3c3677658aad77cf0df (patch) | |
tree | 164fc693771379d5d9439ec72504b00d47af5838 /src | |
parent | Shape elements now handing currentColor attribute. (diff) | |
download | svg-salamander-core-67a0a3be84ffbf18fa7ea3c3677658aad77cf0df.tar.gz svg-salamander-core-67a0a3be84ffbf18fa7ea3c3677658aad77cf0df.tar.xz svg-salamander-core-67a0a3be84ffbf18fa7ea3c3677658aad77cf0df.zip |
RenderableElement clipping should now work even if no clip has been set on Graphics2D.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@110 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/kitfox/svg/RenderableElement.java | 13 |
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);
+ }
}
}
|