From 5403fd8a0728160dbade39dfd3c840a1fe165a09 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 26 Feb 2025 19:03:24 -0500 Subject: [PATCH] fix legacy slice/top conversion --- src/add/array.js | 6 +----- src/kiri/slice.js | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/add/array.js b/src/add/array.js index 4302c26e..93c9b8d3 100644 --- a/src/add/array.js +++ b/src/add/array.js @@ -91,11 +91,7 @@ AP.addOnce = function(val) { * shallow cloning with clone(arg) call on each new element */ AP.clone = function() { - let na = this.slice(), - ln = na.length, - i = 0; - while (i < ln) na[i] = na[i++].clone(...arguments); - return na; + return this.map(v => v.clone(...arguments)); }; AP.xray = function(arg) { diff --git a/src/kiri/slice.js b/src/kiri/slice.js index 8629ba08..612bcde6 100644 --- a/src/kiri/slice.js +++ b/src/kiri/slice.js @@ -147,7 +147,7 @@ class Slice { if (data.length) { // standard legacy polygon let top = new Top(data); - this.tops.push(data); + this.tops.push(top); top.simple = data; return top; } else {