@leafer-game/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 CHANGED
@@ -6637,7 +6637,7 @@ var LeaferUI = function(exports) {
6637
6637
  this.levelMap = null;
6638
6638
  }
6639
6639
  }
6640
- const version = "2.0.5";
6640
+ const version = "2.0.6";
6641
6641
  class LeaferCanvas extends LeaferCanvasBase {
6642
6642
  get allowBackgroundColor() {
6643
6643
  return true;
@@ -8045,6 +8045,7 @@ var LeaferUI = function(exports) {
8045
8045
  createProxyData() {
8046
8046
  return undefined;
8047
8047
  }
8048
+ clearProxyData() {}
8048
8049
  find(_condition, _options) {
8049
8050
  return Plugin.need("find");
8050
8051
  }
@@ -10963,17 +10964,19 @@ var LeaferUI = function(exports) {
10963
10964
  return leafPaint;
10964
10965
  }
10965
10966
  function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds) {
10967
+ let needUpdate = true;
10966
10968
  const data = ui.__;
10967
10969
  if (attrName === "fill" && !data.__naturalWidth) {
10968
10970
  data.__naturalWidth = image.width / data.pixelRatio;
10969
10971
  data.__naturalHeight = image.height / data.pixelRatio;
10970
10972
  if (data.__autoSide) {
10971
10973
  ui.forceUpdate("width");
10974
+ LeafHelper.updateBounds(ui);
10972
10975
  if (ui.__proxyData) {
10973
10976
  ui.setProxyAttr("width", data.width);
10974
10977
  ui.setProxyAttr("height", data.height);
10975
10978
  }
10976
- return false;
10979
+ needUpdate = false;
10977
10980
  }
10978
10981
  }
10979
10982
  if (!leafPaint.data) {
@@ -10983,7 +10986,7 @@ var LeaferUI = function(exports) {
10983
10986
  if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
10984
10987
  }
10985
10988
  if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
10986
- return true;
10989
+ return needUpdate;
10987
10990
  }
10988
10991
  function onLoad(ui, event) {
10989
10992
  emit(ui, ImageEvent.LOAD, event);
@@ -11386,10 +11389,10 @@ var LeaferUI = function(exports) {
11386
11389
  const realFrom = {};
11387
11390
  const realTo = {};
11388
11391
  function conicGradient(paint, box) {
11389
- let {from: from, to: to, type: type, opacity: opacity, stretch: stretch} = paint;
11392
+ let {from: from, to: to, type: type, opacity: opacity, rotation: rotation, stretch: stretch} = paint;
11390
11393
  toPoint(from || "center", box, realFrom);
11391
11394
  toPoint(to || "bottom", box, realTo);
11392
- 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));
11395
+ 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));
11393
11396
  const data = {
11394
11397
  type: type,
11395
11398
  style: style