@leafer/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.
- package/dist/worker.js +14 -10
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +14 -10
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +22 -22
package/dist/worker.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
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6697
6697
|
get allowBackgroundColor() {
|
|
@@ -9256,7 +9256,7 @@ let Text = class Text extends UI {
|
|
|
9256
9256
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
9257
9257
|
data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
|
|
9258
9258
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
|
|
9259
|
-
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize}px ${fontFamily}`;
|
|
9259
|
+
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
|
|
9260
9260
|
data.__clipText = textOverflow !== "show" && !data.__autoSize;
|
|
9261
9261
|
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
|
|
9262
9262
|
}
|
|
@@ -11072,18 +11072,22 @@ const {getSpread: getSpread, getOuterOf: getOuterOf, getByMove: getByMove, getIn
|
|
|
11072
11072
|
|
|
11073
11073
|
function shape(ui, current, options) {
|
|
11074
11074
|
const canvas = current.getSameCanvas();
|
|
11075
|
-
const nowWorld = ui.__nowWorld;
|
|
11075
|
+
const nowWorld = ui.__nowWorld, currentBounds = current.bounds;
|
|
11076
11076
|
let bounds, matrix, fitMatrix, shapeBounds, worldCanvas;
|
|
11077
|
-
let {scaleX: scaleX, scaleY: scaleY} =
|
|
11078
|
-
if (
|
|
11079
|
-
if (scaleY < 0) scaleY = -scaleY;
|
|
11080
|
-
if (current.bounds.includes(nowWorld)) {
|
|
11077
|
+
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
11078
|
+
if (currentBounds.includes(nowWorld)) {
|
|
11081
11079
|
worldCanvas = canvas;
|
|
11082
11080
|
bounds = shapeBounds = nowWorld;
|
|
11083
11081
|
} else {
|
|
11084
11082
|
const {renderShapeSpread: spread} = ui.__layout;
|
|
11085
|
-
|
|
11086
|
-
|
|
11083
|
+
let worldClipBounds;
|
|
11084
|
+
if (Platform.fullImageShadow) {
|
|
11085
|
+
worldClipBounds = nowWorld;
|
|
11086
|
+
} else {
|
|
11087
|
+
const spreadBounds = spread ? getSpread(currentBounds, scaleX === scaleY ? spread * scaleX : [ spread * scaleY, spread * scaleX ]) : currentBounds;
|
|
11088
|
+
worldClipBounds = getIntersectData(spreadBounds, nowWorld);
|
|
11089
|
+
}
|
|
11090
|
+
fitMatrix = currentBounds.getFitMatrix(worldClipBounds);
|
|
11087
11091
|
let {a: fitScaleX, d: fitScaleY} = fitMatrix;
|
|
11088
11092
|
if (fitMatrix.a < 1) {
|
|
11089
11093
|
worldCanvas = current.getSameCanvas();
|