@versa_ai/vmml-editor 1.0.20 → 1.0.22
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/.turbo/turbo-build.log +9 -9
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/EditorCanvas.tsx +55 -39
package/dist/index.mjs
CHANGED
|
@@ -1321,7 +1321,7 @@ var EditorCanvas = forwardRef(
|
|
|
1321
1321
|
const { textContent, backgroundColor, textColor, posParam, fontAssetUrl, alignType, strokeColor, strokeWidth } = clip.textClip;
|
|
1322
1322
|
const scaleX = posParam.scaleX * fontSize / 22 / widthScaleRef.current;
|
|
1323
1323
|
const scaleY = posParam.scaleY * fontSize / 22 / heightScaleRef.current;
|
|
1324
|
-
const strokeW = strokeWidth
|
|
1324
|
+
const strokeW = strokeWidth * 26 * 1.5 / fontSize;
|
|
1325
1325
|
const left = canvasSize.width * posParam.centerX;
|
|
1326
1326
|
const top = canvasSize.height * posParam.centerY;
|
|
1327
1327
|
const bgColor = backgroundColor ? argbToRgba(backgroundColor) : "transparent";
|
|
@@ -1354,6 +1354,7 @@ var EditorCanvas = forwardRef(
|
|
|
1354
1354
|
angle: posParam.rotationZ,
|
|
1355
1355
|
originX: "center",
|
|
1356
1356
|
originY: "center",
|
|
1357
|
+
objectCaching: false,
|
|
1357
1358
|
clipData: {
|
|
1358
1359
|
id: clip.id,
|
|
1359
1360
|
inPoint: clip.inPoint,
|
|
@@ -1432,16 +1433,30 @@ var EditorCanvas = forwardRef(
|
|
|
1432
1433
|
const fontFamily = fontAssetUrl ? getFontFamilyName(fontAssetUrl) : "sansMedium";
|
|
1433
1434
|
lines.forEach((line) => {
|
|
1434
1435
|
const p = document.createElement("p");
|
|
1435
|
-
p.style.
|
|
1436
|
+
p.style.position = "relative";
|
|
1436
1437
|
p.style.fontSize = "22px";
|
|
1437
1438
|
p.style.lineHeight = "22px";
|
|
1438
1439
|
p.style.fontFamily = fontFamily;
|
|
1439
1440
|
p.style.whiteSpace = "nowrap";
|
|
1440
|
-
p.style.padding = "0";
|
|
1441
1441
|
p.style.margin = "0";
|
|
1442
|
-
p.style.
|
|
1443
|
-
p.style.
|
|
1444
|
-
|
|
1442
|
+
p.style.padding = "0";
|
|
1443
|
+
p.style.zIndex = "2";
|
|
1444
|
+
const fill = document.createElement("span");
|
|
1445
|
+
fill.textContent = line || " ";
|
|
1446
|
+
fill.style.color = textColor;
|
|
1447
|
+
fill.style.position = "relative";
|
|
1448
|
+
fill.style.zIndex = "1";
|
|
1449
|
+
const stroke = document.createElement("span");
|
|
1450
|
+
stroke.textContent = line || " ";
|
|
1451
|
+
stroke.style.position = "absolute";
|
|
1452
|
+
stroke.style.left = "0";
|
|
1453
|
+
stroke.style.top = "0";
|
|
1454
|
+
stroke.style.color = "transparent";
|
|
1455
|
+
stroke.style.webkitTextStrokeWidth = `${strokeW}px`;
|
|
1456
|
+
stroke.style.webkitTextStrokeColor = stColor;
|
|
1457
|
+
stroke.style.zIndex = "-1";
|
|
1458
|
+
p.appendChild(fill);
|
|
1459
|
+
p.appendChild(stroke);
|
|
1445
1460
|
container.appendChild(p);
|
|
1446
1461
|
});
|
|
1447
1462
|
container.style.padding = "6.5px 7px 6.5px 7px";
|