- univ.decRefCount(diagramCache.getXMLBase());
- diagramCache = univ.getDiagram(univ.loadSVG(EMPTY_SVG_DATA), false);
- dataHash = "empty";
- univ.incRefCount(diagramCache.getXMLBase());
- bbox = (Rectangle2D) diagramCache.getRoot().getBoundingBox().clone();
+ // Lets check if this should be visible or not
+ Set presentationAttributes = root.getPresentationAttributes();
+ if (!presentationAttributes.contains("display")) {
+ // TODO: fix this - How can one read values of attributes in SVG salamander???
+ univ.decRefCount(diagramCache.getXMLBase());
+ diagramCache = univ.getDiagram(univ.loadSVG(EMPTY_SVG_DATA), false);
+ dataHash = "empty";
+ univ.incRefCount(diagramCache.getXMLBase());
+ bbox = (Rectangle2D) root.getBoundingBox().clone();
+ } else {
+ bbox = new Rectangle2D.Double(0, 0, 0, 0);
+ }