@leafer/worker 2.0.5 → 2.0.6
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 +16 -10
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +16 -10
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +26 -26
package/dist/worker.module.js
CHANGED
|
@@ -7053,7 +7053,7 @@ class LeafLevelList {
|
|
|
7053
7053
|
}
|
|
7054
7054
|
}
|
|
7055
7055
|
|
|
7056
|
-
const version = "2.0.
|
|
7056
|
+
const version = "2.0.6";
|
|
7057
7057
|
|
|
7058
7058
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7059
7059
|
get allowBackgroundColor() {
|
|
@@ -8542,6 +8542,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8542
8542
|
createProxyData() {
|
|
8543
8543
|
return undefined;
|
|
8544
8544
|
}
|
|
8545
|
+
clearProxyData() {}
|
|
8545
8546
|
find(_condition, _options) {
|
|
8546
8547
|
return Plugin.need("find");
|
|
8547
8548
|
}
|
|
@@ -11809,17 +11810,19 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
|
11809
11810
|
}
|
|
11810
11811
|
|
|
11811
11812
|
function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds) {
|
|
11813
|
+
let needUpdate = true;
|
|
11812
11814
|
const data = ui.__;
|
|
11813
11815
|
if (attrName === "fill" && !data.__naturalWidth) {
|
|
11814
11816
|
data.__naturalWidth = image.width / data.pixelRatio;
|
|
11815
11817
|
data.__naturalHeight = image.height / data.pixelRatio;
|
|
11816
11818
|
if (data.__autoSide) {
|
|
11817
11819
|
ui.forceUpdate("width");
|
|
11820
|
+
LeafHelper.updateBounds(ui);
|
|
11818
11821
|
if (ui.__proxyData) {
|
|
11819
11822
|
ui.setProxyAttr("width", data.width);
|
|
11820
11823
|
ui.setProxyAttr("height", data.height);
|
|
11821
11824
|
}
|
|
11822
|
-
|
|
11825
|
+
needUpdate = false;
|
|
11823
11826
|
}
|
|
11824
11827
|
}
|
|
11825
11828
|
if (!leafPaint.data) {
|
|
@@ -11829,7 +11832,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
11829
11832
|
if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
|
|
11830
11833
|
}
|
|
11831
11834
|
if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
|
|
11832
|
-
return
|
|
11835
|
+
return needUpdate;
|
|
11833
11836
|
}
|
|
11834
11837
|
|
|
11835
11838
|
function onLoad(ui, event) {
|
|
@@ -12279,10 +12282,10 @@ const realFrom = {};
|
|
|
12279
12282
|
const realTo = {};
|
|
12280
12283
|
|
|
12281
12284
|
function conicGradient(paint, box) {
|
|
12282
|
-
let {from: from, to: to, type: type, opacity: opacity, stretch: stretch} = paint;
|
|
12285
|
+
let {from: from, to: to, type: type, opacity: opacity, rotation: rotation, stretch: stretch} = paint;
|
|
12283
12286
|
toPoint$1(from || "center", box, realFrom);
|
|
12284
12287
|
toPoint$1(to || "bottom", box, realTo);
|
|
12285
|
-
const style = Platform.conicGradientSupport ? Platform.canvas.createConicGradient(0, realFrom.x, realFrom.y) : Platform.canvas.createRadialGradient(realFrom.x, realFrom.y, 0, realFrom.x, realFrom.y, getDistance$1(realFrom, realTo));
|
|
12288
|
+
const style = Platform.conicGradientSupport ? Platform.canvas.createConicGradient(rotation ? rotation * OneRadian : 0, realFrom.x, realFrom.y) : Platform.canvas.createRadialGradient(realFrom.x, realFrom.y, 0, realFrom.x, realFrom.y, getDistance$1(realFrom, realTo));
|
|
12286
12289
|
const data = {
|
|
12287
12290
|
type: type,
|
|
12288
12291
|
style: style
|
|
@@ -13127,11 +13130,7 @@ function targetAttr(fn) {
|
|
|
13127
13130
|
});
|
|
13128
13131
|
if (isObject(check)) value = check; else if (check === false) return;
|
|
13129
13132
|
}
|
|
13130
|
-
if (t.hasDimOthers)
|
|
13131
|
-
t.setDimOthers(false);
|
|
13132
|
-
t.setBright(false);
|
|
13133
|
-
t.hasDimOthers = undefined;
|
|
13134
|
-
}
|
|
13133
|
+
if (t.hasDimOthers) t.cancelDimOthers();
|
|
13135
13134
|
if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
|
|
13136
13135
|
if (t.single) {
|
|
13137
13136
|
delete t.element.syncEventer;
|
|
@@ -14064,6 +14063,8 @@ class EditBox extends Group {
|
|
|
14064
14063
|
editor.setDimOthers(dimOthers);
|
|
14065
14064
|
editor.setBright(!!dimOthers || bright);
|
|
14066
14065
|
editor.hasDimOthers = true;
|
|
14066
|
+
} else if (editor.hasDimOthers) {
|
|
14067
|
+
editor.cancelDimOthers();
|
|
14067
14068
|
}
|
|
14068
14069
|
if (spread) BoundsHelper.spread(bounds, spread);
|
|
14069
14070
|
if (this.view.worldOpacity) {
|
|
@@ -15103,6 +15104,11 @@ let Editor = class Editor extends Group {
|
|
|
15103
15104
|
setBright(value) {
|
|
15104
15105
|
this.setDimOthers(value, "bright", this.list);
|
|
15105
15106
|
}
|
|
15107
|
+
cancelDimOthers() {
|
|
15108
|
+
this.setDimOthers(false);
|
|
15109
|
+
this.setBright(false);
|
|
15110
|
+
this.hasDimOthers = undefined;
|
|
15111
|
+
}
|
|
15106
15112
|
update() {
|
|
15107
15113
|
if (this.editing) {
|
|
15108
15114
|
if (!this.element.parent) return this.cancel();
|