@leafer-draw/worker 2.0.4 → 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.
@@ -7053,7 +7053,7 @@ class LeafLevelList {
7053
7053
  }
7054
7054
  }
7055
7055
 
7056
- const version = "2.0.4";
7056
+ const version = "2.0.6";
7057
7057
 
7058
7058
  class LeaferCanvas extends LeaferCanvasBase {
7059
7059
  get allowBackgroundColor() {
@@ -8342,6 +8342,7 @@ let UI = UI_1 = class UI extends Leaf {
8342
8342
  createProxyData() {
8343
8343
  return undefined;
8344
8344
  }
8345
+ clearProxyData() {}
8345
8346
  find(_condition, _options) {
8346
8347
  return Plugin.need("find");
8347
8348
  }
@@ -10093,17 +10094,19 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
10093
10094
  }
10094
10095
 
10095
10096
  function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds) {
10097
+ let needUpdate = true;
10096
10098
  const data = ui.__;
10097
10099
  if (attrName === "fill" && !data.__naturalWidth) {
10098
10100
  data.__naturalWidth = image.width / data.pixelRatio;
10099
10101
  data.__naturalHeight = image.height / data.pixelRatio;
10100
10102
  if (data.__autoSide) {
10101
10103
  ui.forceUpdate("width");
10104
+ LeafHelper.updateBounds(ui);
10102
10105
  if (ui.__proxyData) {
10103
10106
  ui.setProxyAttr("width", data.width);
10104
10107
  ui.setProxyAttr("height", data.height);
10105
10108
  }
10106
- return false;
10109
+ needUpdate = false;
10107
10110
  }
10108
10111
  }
10109
10112
  if (!leafPaint.data) {
@@ -10113,7 +10116,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
10113
10116
  if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
10114
10117
  }
10115
10118
  if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
10116
- return true;
10119
+ return needUpdate;
10117
10120
  }
10118
10121
 
10119
10122
  function onLoad(ui, event) {
@@ -10563,10 +10566,10 @@ const realFrom = {};
10563
10566
  const realTo = {};
10564
10567
 
10565
10568
  function conicGradient(paint, box) {
10566
- let {from: from, to: to, type: type, opacity: opacity, stretch: stretch} = paint;
10569
+ let {from: from, to: to, type: type, opacity: opacity, rotation: rotation, stretch: stretch} = paint;
10567
10570
  toPoint(from || "center", box, realFrom);
10568
10571
  toPoint(to || "bottom", box, realTo);
10569
- 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(realFrom, realTo));
10572
+ 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(realFrom, realTo));
10570
10573
  const data = {
10571
10574
  type: type,
10572
10575
  style: style