leafer-draw 2.1.7 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web.js +22 -18
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +22 -18
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +3 -3
package/dist/web.module.js
CHANGED
|
@@ -952,12 +952,12 @@ class Point {
|
|
|
952
952
|
PointHelper.scaleOf(this, origin, scaleX, scaleY);
|
|
953
953
|
return this;
|
|
954
954
|
}
|
|
955
|
-
rotate(rotation, origin) {
|
|
956
|
-
PointHelper.rotate(this, rotation, origin);
|
|
955
|
+
rotate(rotation, origin, radiusX, radiusY) {
|
|
956
|
+
PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
|
|
957
957
|
return this;
|
|
958
958
|
}
|
|
959
|
-
rotateOf(origin, rotation) {
|
|
960
|
-
PointHelper.rotate(this, rotation, origin);
|
|
959
|
+
rotateOf(origin, rotation, radiusX, radiusY) {
|
|
960
|
+
PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
|
|
961
961
|
return this;
|
|
962
962
|
}
|
|
963
963
|
getRotation(origin, to, toOrigin) {
|
|
@@ -980,11 +980,11 @@ class Point {
|
|
|
980
980
|
getDistancePoint(to, distance, changeTo, fromTo) {
|
|
981
981
|
return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo, fromTo));
|
|
982
982
|
}
|
|
983
|
-
getAngle(to) {
|
|
984
|
-
return PointHelper.getAngle(this, to);
|
|
983
|
+
getAngle(to, radiusX, radiusY) {
|
|
984
|
+
return PointHelper.getAngle(this, to, radiusX, radiusY);
|
|
985
985
|
}
|
|
986
|
-
getAtan2(to) {
|
|
987
|
-
return PointHelper.getAtan2(this, to);
|
|
986
|
+
getAtan2(to, radiusX, radiusY) {
|
|
987
|
+
return PointHelper.getAtan2(this, to, radiusX, radiusY);
|
|
988
988
|
}
|
|
989
989
|
isSame(point, quick) {
|
|
990
990
|
return PointHelper.isSame(this, point, quick);
|
|
@@ -4586,7 +4586,9 @@ function sortType(defaultValue) {
|
|
|
4586
4586
|
set(value) {
|
|
4587
4587
|
if (this.__setAttr(key, value)) {
|
|
4588
4588
|
this.waitParent(() => {
|
|
4589
|
-
this
|
|
4589
|
+
const {parent: parent} = this;
|
|
4590
|
+
parent.__layout.childrenSortChange();
|
|
4591
|
+
if (parent.__.flow) parent.__layout.boxChange();
|
|
4590
4592
|
});
|
|
4591
4593
|
}
|
|
4592
4594
|
}
|
|
@@ -4988,7 +4990,7 @@ const LeafHelper = {
|
|
|
4988
4990
|
p = p.parent;
|
|
4989
4991
|
}
|
|
4990
4992
|
},
|
|
4991
|
-
animateMove(t, move, speed = .3) {
|
|
4993
|
+
animateMove(t, move, speed = .3, onAnimate) {
|
|
4992
4994
|
if (!move.x && !move.y) return;
|
|
4993
4995
|
if (Math.abs(move.x) < 1 && Math.abs(move.y) < 1) {
|
|
4994
4996
|
t.move(move);
|
|
@@ -4996,8 +4998,9 @@ const LeafHelper = {
|
|
|
4996
4998
|
const x = move.x * speed, y = move.y * speed;
|
|
4997
4999
|
move.x -= x, move.y -= y;
|
|
4998
5000
|
t.move(x, y);
|
|
4999
|
-
Platform.requestRender(() => L.animateMove(t, move, speed));
|
|
5001
|
+
Platform.requestRender(() => L.animateMove(t, move, speed, onAnimate));
|
|
5000
5002
|
}
|
|
5003
|
+
onAnimate && onAnimate();
|
|
5001
5004
|
}
|
|
5002
5005
|
};
|
|
5003
5006
|
|
|
@@ -6169,6 +6172,7 @@ const LeafBounds = {
|
|
|
6169
6172
|
if (this.isBranch) {
|
|
6170
6173
|
this.__extraUpdate();
|
|
6171
6174
|
if (this.__.flow) {
|
|
6175
|
+
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
6172
6176
|
if (this.__layout.boxChanged) this.__updateFlowLayout();
|
|
6173
6177
|
updateAllMatrix$2(this);
|
|
6174
6178
|
updateBounds$1(this, this);
|
|
@@ -6240,11 +6244,7 @@ const {excludeRenderBounds: excludeRenderBounds$1} = LeafBoundsHelper, {hasSize:
|
|
|
6240
6244
|
|
|
6241
6245
|
const BranchRender = {
|
|
6242
6246
|
__updateChange() {
|
|
6243
|
-
|
|
6244
|
-
if (layout.childrenSortChanged) {
|
|
6245
|
-
this.__updateSortChildren();
|
|
6246
|
-
layout.childrenSortChanged = false;
|
|
6247
|
-
}
|
|
6247
|
+
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
6248
6248
|
this.__.__checkSingle();
|
|
6249
6249
|
},
|
|
6250
6250
|
__render(canvas, options) {
|
|
@@ -6748,6 +6748,7 @@ let Branch = class Branch extends Leaf {
|
|
|
6748
6748
|
children.sort(sort);
|
|
6749
6749
|
this.__layout.affectChildrenSort = affectSort;
|
|
6750
6750
|
}
|
|
6751
|
+
this.__layout.childrenSortChanged = false;
|
|
6751
6752
|
}
|
|
6752
6753
|
add(child, index) {
|
|
6753
6754
|
if (child === this || child.destroyed) return debug$5.warn("add self or destroyed");
|
|
@@ -6983,7 +6984,7 @@ class LeafLevelList {
|
|
|
6983
6984
|
}
|
|
6984
6985
|
}
|
|
6985
6986
|
|
|
6986
|
-
const version = "2.1.
|
|
6987
|
+
const version = "2.1.8";
|
|
6987
6988
|
|
|
6988
6989
|
const debug$4 = Debug.get("LeaferCanvas");
|
|
6989
6990
|
|
|
@@ -9348,7 +9349,10 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9348
9349
|
ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
|
|
9349
9350
|
} else {
|
|
9350
9351
|
if (hasAngle) {
|
|
9351
|
-
if (!closedAngle)
|
|
9352
|
+
if (!closedAngle) {
|
|
9353
|
+
if (!closed) open = true;
|
|
9354
|
+
if (!open) moveTo$3(path, rx, ry);
|
|
9355
|
+
}
|
|
9352
9356
|
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
|
|
9353
9357
|
} else {
|
|
9354
9358
|
ellipse(path, rx, ry, rx, ry);
|