@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.js
CHANGED
|
@@ -2023,7 +2023,7 @@ var LeaferUI = function(exports) {
|
|
|
2023
2023
|
this.innerId = IncrementId.create(IncrementId.CNAVAS);
|
|
2024
2024
|
const {width: width, height: height, pixelRatio: pixelRatio} = config;
|
|
2025
2025
|
this.autoLayout = !width || !height;
|
|
2026
|
-
this.size.pixelRatio = pixelRatio
|
|
2026
|
+
this.size.pixelRatio = pixelRatio || Platform.devicePixelRatio;
|
|
2027
2027
|
this.config = config;
|
|
2028
2028
|
this.init();
|
|
2029
2029
|
}
|
|
@@ -6297,7 +6297,7 @@ var LeaferUI = function(exports) {
|
|
|
6297
6297
|
this.levelMap = null;
|
|
6298
6298
|
}
|
|
6299
6299
|
}
|
|
6300
|
-
const version = "1.9.
|
|
6300
|
+
const version = "1.9.1";
|
|
6301
6301
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6302
6302
|
get allowBackgroundColor() {
|
|
6303
6303
|
return true;
|
|
@@ -8621,7 +8621,7 @@ var LeaferUI = function(exports) {
|
|
|
8621
8621
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
8622
8622
|
data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
|
|
8623
8623
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
|
|
8624
|
-
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize}px ${fontFamily}`;
|
|
8624
|
+
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
|
|
8625
8625
|
data.__clipText = textOverflow !== "show" && !data.__autoSize;
|
|
8626
8626
|
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
|
|
8627
8627
|
}
|
|
@@ -10268,18 +10268,22 @@ var LeaferUI = function(exports) {
|
|
|
10268
10268
|
const {getSpread: getSpread, getOuterOf: getOuterOf, getByMove: getByMove, getIntersectData: getIntersectData} = BoundsHelper;
|
|
10269
10269
|
function shape(ui, current, options) {
|
|
10270
10270
|
const canvas = current.getSameCanvas();
|
|
10271
|
-
const nowWorld = ui.__nowWorld;
|
|
10271
|
+
const nowWorld = ui.__nowWorld, currentBounds = current.bounds;
|
|
10272
10272
|
let bounds, matrix, fitMatrix, shapeBounds, worldCanvas;
|
|
10273
|
-
let {scaleX: scaleX, scaleY: scaleY} =
|
|
10274
|
-
if (
|
|
10275
|
-
if (scaleY < 0) scaleY = -scaleY;
|
|
10276
|
-
if (current.bounds.includes(nowWorld)) {
|
|
10273
|
+
let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
|
|
10274
|
+
if (currentBounds.includes(nowWorld)) {
|
|
10277
10275
|
worldCanvas = canvas;
|
|
10278
10276
|
bounds = shapeBounds = nowWorld;
|
|
10279
10277
|
} else {
|
|
10280
10278
|
const {renderShapeSpread: spread} = ui.__layout;
|
|
10281
|
-
|
|
10282
|
-
|
|
10279
|
+
let worldClipBounds;
|
|
10280
|
+
if (Platform.fullImageShadow) {
|
|
10281
|
+
worldClipBounds = nowWorld;
|
|
10282
|
+
} else {
|
|
10283
|
+
const spreadBounds = spread ? getSpread(currentBounds, scaleX === scaleY ? spread * scaleX : [ spread * scaleY, spread * scaleX ]) : currentBounds;
|
|
10284
|
+
worldClipBounds = getIntersectData(spreadBounds, nowWorld);
|
|
10285
|
+
}
|
|
10286
|
+
fitMatrix = currentBounds.getFitMatrix(worldClipBounds);
|
|
10283
10287
|
let {a: fitScaleX, d: fitScaleY} = fitMatrix;
|
|
10284
10288
|
if (fitMatrix.a < 1) {
|
|
10285
10289
|
worldCanvas = current.getSameCanvas();
|