diff options
author | kitfox | 2014-06-25 18:49:44 +0200 |
---|---|---|
committer | kitfox | 2014-06-25 18:49:44 +0200 |
commit | 21f4905a7440f21965fb447ae30f1ed4e856b289 (patch) | |
tree | 710133c1f73a4726b090d1ef87742f8c13d320db /src/main/java/com/kitfox/svg/Group.java | |
parent | ClipPath now propegates updateTime() to children. (diff) | |
download | svg-salamander-core-21f4905a7440f21965fb447ae30f1ed4e856b289.tar.gz svg-salamander-core-21f4905a7440f21965fb447ae30f1ed4e856b289.tar.xz svg-salamander-core-21f4905a7440f21965fb447ae30f1ed4e856b289.zip |
Fixing JIRA SVGSALAMANDER-37 and SVGSALAMANDER-38. Viewbox now maps to full viewport. Calculating the group bounding box now ignores rectangles of zero size. (This is itself an error - shapes with no content should instead indicate a bounding box of null, but making that change would likely break a lot of things).
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@177 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
Diffstat (limited to 'src/main/java/com/kitfox/svg/Group.java')
-rw-r--r-- | src/main/java/com/kitfox/svg/Group.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main/java/com/kitfox/svg/Group.java b/src/main/java/com/kitfox/svg/Group.java index 78320ff..3fb8710 100644 --- a/src/main/java/com/kitfox/svg/Group.java +++ b/src/main/java/com/kitfox/svg/Group.java @@ -159,10 +159,10 @@ public class Group extends ShapeElement //Do not process offscreen groups
boolean ignoreClip = diagram.ignoringClipHeuristic();
- if (!ignoreClip && outsideClip(g))
- {
- return;
- }
+// if (!ignoreClip && outsideClip(g))
+// {
+// return;
+// }
beginLayer(g);
@@ -270,14 +270,18 @@ public class Group extends ShapeElement {
RenderableElement rendEle = (RenderableElement) ele;
Rectangle2D bounds = rendEle.getBoundingBox();
- if (bounds != null)
+ if (bounds != null && (bounds.getWidth() != 0 || bounds.getHeight() != 0))
{
if (retRect == null)
{
retRect = bounds;
- } else
+ }
+ else
{
- retRect = retRect.createUnion(bounds);
+ if (retRect.getWidth() != 0 || retRect.getHeight() != 0)
+ {
+ retRect = retRect.createUnion(bounds);
+ }
}
}
}
|