mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Item#_getBounds: don't include bounds of hidden items.
This commit is contained in:
parent
4490403ae9
commit
34077dc901
1 changed files with 10 additions and 8 deletions
|
@ -458,8 +458,9 @@ 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
|
||||
var child = children[i];
|
||||
if (child.visible) {
|
||||
var rect = includeStroke
|
||||
? child.getStrokeBounds()
|
||||
: child.getBounds();
|
||||
x1 = Math.min(rect.x, x1);
|
||||
|
@ -467,6 +468,7 @@ var Item = this.Item = Base.extend({
|
|||
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)
|
||||
: LinkedRectangle.create(this, 'setBounds',
|
||||
|
|
Loading…
Reference in a new issue