diff --git a/examples/Scripts/RotationRaster.html b/examples/Scripts/RotationRaster.html index fe6dc12e..fca7ff49 100644 --- a/examples/Scripts/RotationRaster.html +++ b/examples/Scripts/RotationRaster.html @@ -7,24 +7,35 @@
diff --git a/src/item/Item.js b/src/item/Item.js index 7ca7feaf..8d4829c7 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -458,14 +458,16 @@ var Item = this.Item = Base.extend({ y1 = x1, y2 = x2; for (var i = 0, l = children.length; i < l; i++) { - var child = children[i], - rect = includeStroke - ? child.getStrokeBounds() - : child.getBounds(); - x1 = Math.min(rect.x, x1); - y1 = Math.min(rect.y, y1); - x2 = Math.max(rect.x + rect.width, x2); - y2 = Math.max(rect.y + rect.height, y2); + var child = children[i]; + if (child.visible) { + var rect = includeStroke + ? child.getStrokeBounds() + : child.getBounds(); + x1 = Math.min(rect.x, x1); + y1 = Math.min(rect.y, y1); + x2 = Math.max(rect.x + rect.width, x2); + y2 = Math.max(rect.y + rect.height, y2); + } } return includeStroke ? Rectangle.create(x1, y1, x2 - x1, y2 - y1) diff --git a/src/util/PaperScript.js b/src/util/PaperScript.js index 121d0bd5..9b74a6a8 100644 --- a/src/util/PaperScript.js +++ b/src/util/PaperScript.js @@ -154,15 +154,18 @@ var PaperScript = this.PaperScript = new function() { DomEvent.requestAnimationFrame(frame, doc && doc.canvas); onFrame(); // Automatically redraw document each frame. - doc && doc.redraw(); - } - DomEvent.requestAnimationFrame(frame, doc && doc.canvas); + if (doc) + doc.redraw(); + }; + // Call the onFrame handler and redraw the document: + frame(); + } else { + // Automatically redraw document at the end. + if (doc) + doc.redraw(); } } catch (e) { } - // Automatically redraw document at the end. - if (doc) - doc.redraw(); return res; } }