@leafer-draw/worker 1.9.0 → 1.9.1

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.
@@ -2181,7 +2181,7 @@ class LeaferCanvasBase extends Canvas$1 {
2181
2181
  this.innerId = IncrementId.create(IncrementId.CNAVAS);
2182
2182
  const {width: width, height: height, pixelRatio: pixelRatio} = config;
2183
2183
  this.autoLayout = !width || !height;
2184
- this.size.pixelRatio = pixelRatio | Platform.devicePixelRatio;
2184
+ this.size.pixelRatio = pixelRatio || Platform.devicePixelRatio;
2185
2185
  this.config = config;
2186
2186
  this.init();
2187
2187
  }
@@ -6691,7 +6691,7 @@ class LeafLevelList {
6691
6691
  }
6692
6692
  }
6693
6693
 
6694
- const version = "1.9.0";
6694
+ const version = "1.9.1";
6695
6695
 
6696
6696
  class LeaferCanvas extends LeaferCanvasBase {
6697
6697
  get allowBackgroundColor() {
@@ -9074,7 +9074,7 @@ let Text = class Text extends UI {
9074
9074
  data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
9075
9075
  data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
9076
9076
  data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
9077
- data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize}px ${fontFamily}`;
9077
+ data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
9078
9078
  data.__clipText = textOverflow !== "show" && !data.__autoSize;
9079
9079
  data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
9080
9080
  }
@@ -9487,18 +9487,22 @@ const {getSpread: getSpread, getOuterOf: getOuterOf, getByMove: getByMove, getIn
9487
9487
 
9488
9488
  function shape(ui, current, options) {
9489
9489
  const canvas = current.getSameCanvas();
9490
- const nowWorld = ui.__nowWorld;
9490
+ const nowWorld = ui.__nowWorld, currentBounds = current.bounds;
9491
9491
  let bounds, matrix, fitMatrix, shapeBounds, worldCanvas;
9492
- let {scaleX: scaleX, scaleY: scaleY} = nowWorld;
9493
- if (scaleX < 0) scaleX = -scaleX;
9494
- if (scaleY < 0) scaleY = -scaleY;
9495
- if (current.bounds.includes(nowWorld)) {
9492
+ let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
9493
+ if (currentBounds.includes(nowWorld)) {
9496
9494
  worldCanvas = canvas;
9497
9495
  bounds = shapeBounds = nowWorld;
9498
9496
  } else {
9499
9497
  const {renderShapeSpread: spread} = ui.__layout;
9500
- const worldClipBounds = getIntersectData(spread ? getSpread(current.bounds, scaleX === scaleY ? spread * scaleX : [ spread * scaleY, spread * scaleX ]) : current.bounds, nowWorld);
9501
- fitMatrix = current.bounds.getFitMatrix(worldClipBounds);
9498
+ let worldClipBounds;
9499
+ if (Platform.fullImageShadow) {
9500
+ worldClipBounds = nowWorld;
9501
+ } else {
9502
+ const spreadBounds = spread ? getSpread(currentBounds, scaleX === scaleY ? spread * scaleX : [ spread * scaleY, spread * scaleX ]) : currentBounds;
9503
+ worldClipBounds = getIntersectData(spreadBounds, nowWorld);
9504
+ }
9505
+ fitMatrix = currentBounds.getFitMatrix(worldClipBounds);
9502
9506
  let {a: fitScaleX, d: fitScaleY} = fitMatrix;
9503
9507
  if (fitMatrix.a < 1) {
9504
9508
  worldCanvas = current.getSameCanvas();