From 21f4905a7440f21965fb447ae30f1ed4e856b289 Mon Sep 17 00:00:00 2001 From: kitfox Date: Wed, 25 Jun 2014 16:49:44 +0000 Subject: 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 --- src/main/java/com/kitfox/svg/Group.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/kitfox/svg/Group.java') 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); + } } } } -- cgit v1.2.3-55-g7522