@leafer-draw/worker 1.9.3 → 1.9.4
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/worker.js +22 -24
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +22 -24
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +9 -9
package/dist/worker.js
CHANGED
|
@@ -49,7 +49,7 @@ var LeaferUI = function(exports) {
|
|
|
49
49
|
return value === undefined;
|
|
50
50
|
}
|
|
51
51
|
function isNull(value) {
|
|
52
|
-
return value
|
|
52
|
+
return value == null;
|
|
53
53
|
}
|
|
54
54
|
function isString(value) {
|
|
55
55
|
return typeof value === "string";
|
|
@@ -285,6 +285,9 @@ var LeaferUI = function(exports) {
|
|
|
285
285
|
num = round$3(num * a) / a;
|
|
286
286
|
return num === -0 ? 0 : num;
|
|
287
287
|
},
|
|
288
|
+
sign(num) {
|
|
289
|
+
return num < 0 ? -1 : 1;
|
|
290
|
+
},
|
|
288
291
|
getScaleData(scale, size, originSize, scaleData) {
|
|
289
292
|
if (!scaleData) scaleData = {};
|
|
290
293
|
if (size) {
|
|
@@ -3867,7 +3870,7 @@ var LeaferUI = function(exports) {
|
|
|
3867
3870
|
return {
|
|
3868
3871
|
get() {
|
|
3869
3872
|
const v = this[privateKey];
|
|
3870
|
-
return
|
|
3873
|
+
return v == null ? defaultValue : v;
|
|
3871
3874
|
},
|
|
3872
3875
|
set(value) {
|
|
3873
3876
|
this[privateKey] = value;
|
|
@@ -4120,21 +4123,21 @@ var LeaferUI = function(exports) {
|
|
|
4120
4123
|
};
|
|
4121
4124
|
} else if (typeof defaultValue === "function") {
|
|
4122
4125
|
property.get = function() {
|
|
4123
|
-
|
|
4124
|
-
return v
|
|
4126
|
+
const v = this[computedKey];
|
|
4127
|
+
return v == null ? defaultValue(this.__leaf) : v;
|
|
4125
4128
|
};
|
|
4126
4129
|
} else if (isObject(defaultValue)) {
|
|
4127
4130
|
const isEmpty = isEmptyData(defaultValue);
|
|
4128
4131
|
property.get = function() {
|
|
4129
|
-
|
|
4130
|
-
return v
|
|
4132
|
+
const v = this[computedKey];
|
|
4133
|
+
return v == null ? this[computedKey] = isEmpty ? {} : DataHelper.clone(defaultValue) : v;
|
|
4131
4134
|
};
|
|
4132
4135
|
}
|
|
4133
4136
|
const isBox = target.isBranchLeaf;
|
|
4134
4137
|
if (key === "width") {
|
|
4135
4138
|
property.get = function() {
|
|
4136
4139
|
const v = this[computedKey];
|
|
4137
|
-
if (v
|
|
4140
|
+
if (v == null) {
|
|
4138
4141
|
const t = this, naturalWidth = t.__naturalWidth, leaf = t.__leaf;
|
|
4139
4142
|
if (!defaultValue || leaf.pathInputed) return leaf.boxBounds.width;
|
|
4140
4143
|
if (naturalWidth) return t._height && t.__useNaturalRatio ? t._height * naturalWidth / t.__naturalHeight : naturalWidth;
|
|
@@ -4144,7 +4147,7 @@ var LeaferUI = function(exports) {
|
|
|
4144
4147
|
} else if (key === "height") {
|
|
4145
4148
|
property.get = function() {
|
|
4146
4149
|
const v = this[computedKey];
|
|
4147
|
-
if (v
|
|
4150
|
+
if (v == null) {
|
|
4148
4151
|
const t = this, naturalHeight = t.__naturalHeight, leaf = t.__leaf;
|
|
4149
4152
|
if (!defaultValue || leaf.pathInputed) return leaf.boxBounds.height;
|
|
4150
4153
|
if (naturalHeight) return t._width && t.__useNaturalRatio ? t._width * naturalHeight / t.__naturalWidth : naturalHeight;
|
|
@@ -4876,7 +4879,7 @@ var LeaferUI = function(exports) {
|
|
|
4876
4879
|
}
|
|
4877
4880
|
boxChange() {
|
|
4878
4881
|
this.boxChanged = true;
|
|
4879
|
-
this.localBoxChanged || this.localBoxChange();
|
|
4882
|
+
this.localBoxChanged ? this.boundsChanged || (this.boundsChanged = true) : this.localBoxChange();
|
|
4880
4883
|
this.hitCanvasChanged = true;
|
|
4881
4884
|
}
|
|
4882
4885
|
localBoxChange() {
|
|
@@ -4910,7 +4913,7 @@ var LeaferUI = function(exports) {
|
|
|
4910
4913
|
}
|
|
4911
4914
|
matrixChange() {
|
|
4912
4915
|
this.matrixChanged = true;
|
|
4913
|
-
this.localBoxChanged || this.localBoxChange();
|
|
4916
|
+
this.localBoxChanged ? this.boundsChanged || (this.boundsChanged = true) : this.localBoxChange();
|
|
4914
4917
|
}
|
|
4915
4918
|
surfaceChange() {
|
|
4916
4919
|
this.surfaceChanged = true;
|
|
@@ -5884,10 +5887,10 @@ var LeaferUI = function(exports) {
|
|
|
5884
5887
|
relative.innerToWorld(world, to, distance);
|
|
5885
5888
|
world = to ? to : world;
|
|
5886
5889
|
}
|
|
5887
|
-
toInnerPoint(this.
|
|
5890
|
+
toInnerPoint(this.scrollWorldTransform, world, to, distance);
|
|
5888
5891
|
}
|
|
5889
5892
|
innerToWorld(inner, to, distance, relative) {
|
|
5890
|
-
toOuterPoint(this.
|
|
5893
|
+
toOuterPoint(this.scrollWorldTransform, inner, to, distance);
|
|
5891
5894
|
if (relative) relative.worldToInner(to ? to : inner, null, distance);
|
|
5892
5895
|
}
|
|
5893
5896
|
getBoxPoint(world, relative, distance, change) {
|
|
@@ -6341,7 +6344,7 @@ var LeaferUI = function(exports) {
|
|
|
6341
6344
|
this.levelMap = null;
|
|
6342
6345
|
}
|
|
6343
6346
|
}
|
|
6344
|
-
const version = "1.9.
|
|
6347
|
+
const version = "1.9.4";
|
|
6345
6348
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6346
6349
|
get allowBackgroundColor() {
|
|
6347
6350
|
return true;
|
|
@@ -8188,29 +8191,24 @@ var LeaferUI = function(exports) {
|
|
|
8188
8191
|
}
|
|
8189
8192
|
__updateStrokeBounds() {}
|
|
8190
8193
|
__updateRenderBounds() {
|
|
8191
|
-
let isOverflow;
|
|
8194
|
+
let isOverflow, isScrollMode;
|
|
8192
8195
|
if (this.children.length) {
|
|
8193
|
-
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout;
|
|
8196
|
+
const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout, {overflow: overflow} = data;
|
|
8194
8197
|
const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
|
|
8195
8198
|
super.__updateRenderBounds(childrenRenderBounds);
|
|
8196
|
-
if (
|
|
8199
|
+
if (isScrollMode = overflow.includes("scroll")) {
|
|
8197
8200
|
add(childrenRenderBounds, boxBounds);
|
|
8198
8201
|
scroll(childrenRenderBounds, data);
|
|
8199
8202
|
}
|
|
8200
8203
|
this.__updateRectRenderBounds();
|
|
8201
8204
|
isOverflow = !includes$1(boxBounds, childrenRenderBounds);
|
|
8202
|
-
if (isOverflow &&
|
|
8205
|
+
if (isOverflow && overflow === "show") add(renderBounds, childrenRenderBounds);
|
|
8203
8206
|
} else this.__updateRectRenderBounds();
|
|
8204
8207
|
DataHelper.stintSet(this, "isOverflow", isOverflow);
|
|
8205
|
-
this.__checkScroll();
|
|
8208
|
+
this.__checkScroll(isScrollMode);
|
|
8206
8209
|
}
|
|
8207
8210
|
__updateRectRenderBounds() {}
|
|
8208
|
-
|
|
8209
|
-
if (this.hasScroller) this.__updateScroll();
|
|
8210
|
-
super.__updateWorldBounds();
|
|
8211
|
-
}
|
|
8212
|
-
__checkScroll() {}
|
|
8213
|
-
__updateScroll() {}
|
|
8211
|
+
__checkScroll(_isScrollMode) {}
|
|
8214
8212
|
__updateRectChange() {}
|
|
8215
8213
|
__updateChange() {
|
|
8216
8214
|
super.__updateChange();
|