leafer-draw 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.
- package/dist/web.cjs +11 -7
- package/dist/web.esm.js +11 -7
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +14 -10
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +14 -10
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +3 -3
package/dist/web.module.js
CHANGED
|
@@ -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
|
|
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.
|
|
6694
|
+
const version = "1.9.1";
|
|
6695
6695
|
|
|
6696
6696
|
const debug$4 = Debug.get("LeaferCanvas");
|
|
6697
6697
|
|
|
@@ -9259,7 +9259,7 @@ let Text = class Text extends UI {
|
|
|
9259
9259
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
9260
9260
|
data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
|
|
9261
9261
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
|
|
9262
|
-
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize}px ${fontFamily}`;
|
|
9262
|
+
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
|
|
9263
9263
|
data.__clipText = textOverflow !== "show" && !data.__autoSize;
|
|
9264
9264
|
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
|
|
9265
9265
|
}
|
|
@@ -9672,18 +9672,22 @@ const {getSpread: getSpread, getOuterOf: getOuterOf, getByMove: getByMove, getIn
|
|
|
9672
9672
|
|
|
9673
9673
|
function shape(ui, current, options) {
|
|
9674
9674
|
const canvas = current.getSameCanvas();
|
|
9675
|
-
const nowWorld = ui.__nowWorld;
|
|
9675
|
+
const nowWorld = ui.__nowWorld, currentBounds = current.bounds;
|
|
9676
9676
|
let bounds, matrix, fitMatrix, shapeBounds, worldCanvas;
|
|
9677
|
-
let {scaleX: scaleX, scaleY: scaleY} =
|
|
9678
|
-
if (
|
|
9679
|
-
if (scaleY < 0) scaleY = -scaleY;
|
|
9680
|
-
if (current.bounds.includes(nowWorld)) {
|
|
9677
|
+
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
9678
|
+
if (currentBounds.includes(nowWorld)) {
|
|
9681
9679
|
worldCanvas = canvas;
|
|
9682
9680
|
bounds = shapeBounds = nowWorld;
|
|
9683
9681
|
} else {
|
|
9684
9682
|
const {renderShapeSpread: spread} = ui.__layout;
|
|
9685
|
-
|
|
9686
|
-
|
|
9683
|
+
let worldClipBounds;
|
|
9684
|
+
if (Platform.fullImageShadow) {
|
|
9685
|
+
worldClipBounds = nowWorld;
|
|
9686
|
+
} else {
|
|
9687
|
+
const spreadBounds = spread ? getSpread(currentBounds, scaleX === scaleY ? spread * scaleX : [ spread * scaleY, spread * scaleX ]) : currentBounds;
|
|
9688
|
+
worldClipBounds = getIntersectData(spreadBounds, nowWorld);
|
|
9689
|
+
}
|
|
9690
|
+
fitMatrix = currentBounds.getFitMatrix(worldClipBounds);
|
|
9687
9691
|
let {a: fitScaleX, d: fitScaleY} = fitMatrix;
|
|
9688
9692
|
if (fitMatrix.a < 1) {
|
|
9689
9693
|
worldCanvas = current.getSameCanvas();
|