Resolved performance bottleneck in merge function (#999)

main
Boris Sekachev 6 years ago committed by Nikita Manovich
parent 7c9043974b
commit 2e8af445db

@ -135,7 +135,6 @@ class ShapeMergerModel extends Listener {
object.shapes.push( object.shapes.push(
Object.assign(shapeDict[frame].interpolation.position, Object.assign(shapeDict[frame].interpolation.position,
{ {
z_order: this._collectionModel.zOrder(frame).max,
frame: frame, frame: frame,
attributes: shapeAttributes attributes: shapeAttributes
} }
@ -150,7 +149,7 @@ class ShapeMergerModel extends Listener {
let copy = Object.assign({}, object.shapes[object.shapes.length - 1]); let copy = Object.assign({}, object.shapes[object.shapes.length - 1]);
copy.outside = true; copy.outside = true;
copy.frame += 1; copy.frame += 1;
copy.z_order = this._collectionModel.zOrder(frame).max; copy.z_order = 0;
copy.attributes = []; copy.attributes = [];
object.shapes.push(copy); object.shapes.push(copy);
} }

Loading…
Cancel
Save