laymur 0.10.1 → 0.10.3
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/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1894,7 +1894,7 @@ class UIColor extends i {
|
|
|
1894
1894
|
this._private_bInternal = b;
|
|
1895
1895
|
this._private_aInternal = a;
|
|
1896
1896
|
}
|
|
1897
|
-
else {
|
|
1897
|
+
else if (args.length >= 1) {
|
|
1898
1898
|
const [firstArgument, a = 1] = args;
|
|
1899
1899
|
if (typeof firstArgument === "string") {
|
|
1900
1900
|
this.setColorName(firstArgument, a);
|
|
@@ -6630,7 +6630,7 @@ function splitText(text) {
|
|
|
6630
6630
|
return text.match(/\S+|\s|\n/g) ?? [];
|
|
6631
6631
|
}
|
|
6632
6632
|
function measureTextChunk(context, chunk, style) {
|
|
6633
|
-
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;
|
|
6633
|
+
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px "${style.fontFamily}"`;
|
|
6634
6634
|
if (chunk === "\n") {
|
|
6635
6635
|
return {
|
|
6636
6636
|
width: Math.ceil(1),
|
|
@@ -6721,7 +6721,7 @@ function calculateTextSize(lines) {
|
|
|
6721
6721
|
return { width: maxLineWidth, height: totalHeight };
|
|
6722
6722
|
}
|
|
6723
6723
|
function renderText(x, y, text, style, context) {
|
|
6724
|
-
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;
|
|
6724
|
+
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px "${style.fontFamily}"`;
|
|
6725
6725
|
if (style.enableShadow) {
|
|
6726
6726
|
context.shadowOffsetX = style.shadowOffsetX;
|
|
6727
6727
|
context.shadowOffsetY = style.shadowOffsetY;
|