handle bounding box correctly for objects with multiple layers
This commit is contained in:
+6
-3
@@ -1788,9 +1788,12 @@ class GraphicsObject {
|
|||||||
}
|
}
|
||||||
bbox() {
|
bbox() {
|
||||||
let bbox;
|
let bbox;
|
||||||
if (this.currentFrame.shapes.length > 0) {
|
for (let layer of this.layers) {
|
||||||
bbox = structuredClone(this.currentFrame.shapes[0].boundingBox)
|
let frame = layer.getFrame(this.currentFrameNum)
|
||||||
for (let shape of this.currentFrame.shapes) {
|
if (frame.shapes.length > 0 && bbox == undefined) {
|
||||||
|
bbox = structuredClone(frame.shapes[0].boundingBox)
|
||||||
|
}
|
||||||
|
for (let shape of frame.shapes) {
|
||||||
growBoundingBox(bbox, shape.boundingBox)
|
growBoundingBox(bbox, shape.boundingBox)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user