leafer-draw 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.
@@ -7053,7 +7053,7 @@ class LeafLevelList {
7053
7053
  }
7054
7054
  }
7055
7055
 
7056
- const version = "2.0.5";
7056
+ const version = "2.0.6";
7057
7057
 
7058
7058
  const debug$4 = Debug.get("LeaferCanvas");
7059
7059
 
@@ -7349,7 +7349,6 @@ defineKey(Platform, "devicePixelRatio", {
7349
7349
  const {userAgent: userAgent} = navigator;
7350
7350
 
7351
7351
  if (userAgent.indexOf("Firefox") > -1) {
7352
- Platform.conicGradientRotate90 = true;
7353
7352
  Platform.intWheelDeltaY = true;
7354
7353
  Platform.syncDomFont = true;
7355
7354
  } else if (/iPhone|iPad|iPod/.test(navigator.userAgent) || /Macintosh/.test(navigator.userAgent) && /Version\/[\d.]+.*Safari/.test(navigator.userAgent)) {
@@ -8537,6 +8536,7 @@ let UI = UI_1 = class UI extends Leaf {
8537
8536
  createProxyData() {
8538
8537
  return undefined;
8539
8538
  }
8539
+ clearProxyData() {}
8540
8540
  find(_condition, _options) {
8541
8541
  return Plugin.need("find");
8542
8542
  }
@@ -10288,17 +10288,19 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
10288
10288
  }
10289
10289
 
10290
10290
  function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds) {
10291
+ let needUpdate = true;
10291
10292
  const data = ui.__;
10292
10293
  if (attrName === "fill" && !data.__naturalWidth) {
10293
10294
  data.__naturalWidth = image.width / data.pixelRatio;
10294
10295
  data.__naturalHeight = image.height / data.pixelRatio;
10295
10296
  if (data.__autoSide) {
10296
10297
  ui.forceUpdate("width");
10298
+ LeafHelper.updateBounds(ui);
10297
10299
  if (ui.__proxyData) {
10298
10300
  ui.setProxyAttr("width", data.width);
10299
10301
  ui.setProxyAttr("height", data.height);
10300
10302
  }
10301
- return false;
10303
+ needUpdate = false;
10302
10304
  }
10303
10305
  }
10304
10306
  if (!leafPaint.data) {
@@ -10308,7 +10310,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
10308
10310
  if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
10309
10311
  }
10310
10312
  if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
10311
- return true;
10313
+ return needUpdate;
10312
10314
  }
10313
10315
 
10314
10316
  function onLoad(ui, event) {
@@ -10758,10 +10760,10 @@ const realFrom = {};
10758
10760
  const realTo = {};
10759
10761
 
10760
10762
  function conicGradient(paint, box) {
10761
- let {from: from, to: to, type: type, opacity: opacity, stretch: stretch} = paint;
10763
+ let {from: from, to: to, type: type, opacity: opacity, rotation: rotation, stretch: stretch} = paint;
10762
10764
  toPoint(from || "center", box, realFrom);
10763
10765
  toPoint(to || "bottom", box, realTo);
10764
- 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));
10766
+ 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));
10765
10767
  const data = {
10766
10768
  type: type,
10767
10769
  style: style