From 2ebc85458fc18f4e412a2e8592fec99f9a1b8e99 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sun, 4 Jul 2021 21:17:30 -0400 Subject: [PATCH] trim more fields that don't need to be pre-allocated --- src/geo/point.js | 3 ++- src/geo/polygon.js | 6 ++++-- src/kiri/main.js | 4 ---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/geo/point.js b/src/geo/point.js index 78f1d00b..b8241524 100644 --- a/src/geo/point.js +++ b/src/geo/point.js @@ -20,7 +20,6 @@ if (key) { this._key = key; } - this.poly = null; // parent polygon } get key() { @@ -38,7 +37,9 @@ const PRO = Point.prototype; BASE.Point = Point; + BASE.newPoint = newPoint; + BASE.pointFromClipper = function(cp, z) { return newPoint(cp.X / CONF.clipper, cp.Y / CONF.clipper, z); }; diff --git a/src/geo/polygon.js b/src/geo/polygon.js index 40b1a8e7..973859f8 100644 --- a/src/geo/polygon.js +++ b/src/geo/polygon.js @@ -31,9 +31,10 @@ this.id = seqid++; // polygon unique id this.open = false; this.points = []; // ordered array of points - this.parent = null; // enclosing parent polygon this.depth = 0; // depth nested from top parent (density for support fill) - if (points) this.addPoints(points); + if (points) { + this.addPoints(points); + } } get length() { @@ -63,6 +64,7 @@ } BASE.Polygon = Polygon; + BASE.newPolygon = newPolygon; const PRO = Polygon.prototype; diff --git a/src/kiri/main.js b/src/kiri/main.js index d282c8b4..c1d1b554 100644 --- a/src/kiri/main.js +++ b/src/kiri/main.js @@ -2912,10 +2912,6 @@ console.log/** Copyright Stewart Allen -- All Rights Reserved */ DOC.activeElement.blur(); } - // function setExpert(bool) { - // UC.setExpert(UI.expert.checked = settings.controller.expert = bool); - // } - function getMode() { return settings.mode; }