Skip to content

Commit f011df1

Browse files
committed
Fix stroke color placeholder
1 parent 8d1b1d8 commit f011df1

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

module.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"email": "dev7355608@gmail.com"
1010
}
1111
],
12-
"version": "2.0.4",
12+
"version": "2.0.5",
1313
"compatibility": {
1414
"minimum": "10.276",
1515
"verified": "10.291",
@@ -29,8 +29,8 @@
2929
},
3030
"url": "https://github.com/dev7355608/advanced-drawing-tools",
3131
"manifest": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/module.json",
32-
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.4/module.zip",
33-
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.4",
32+
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.5/module.zip",
33+
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.5",
3434
"bugs": "https://github.com/dev7355608/advanced-drawing-tools/issues",
3535
"readme": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/README.md",
3636
"license": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/LICENSE"

scripts/config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ Hooks.on("renderDrawingConfig", (app, html) => {
321321
</div>
322322
`);
323323

324-
const updateStrokeColorPlaceholder = () => {
324+
const updateStrokeColorPlaceholder = (event) => {
325325
let textColor;
326326

327327
if (event?.target.type === "color") {
@@ -330,10 +330,10 @@ Hooks.on("renderDrawingConfig", (app, html) => {
330330
textColor = html.find(`input[name="textColor"]`).val();
331331
}
332332

333-
html.find(`input[name="flags.advanced-drawing-tools.textStyle.stroke"],input[data-edit="flags.advanced-drawing-tools.textStyle.stroke"]`).attr(
334-
"placeholder",
335-
Color.from(textColor || "#FFFFFF").hsv[2] > 0.6 ? "#000000" : "#FFFFFF"
336-
);
333+
const strokeColor = Color.from(textColor || "#ffffff").hsv[2] > 0.6 ? "#000000" : "#ffffff";
334+
335+
html.find(`input[name="flags.advanced-drawing-tools.textStyle.stroke"]`).attr("placeholder", strokeColor);
336+
html.find(`input[data-edit="flags.advanced-drawing-tools.textStyle.stroke"]`).val(strokeColor);
337337
};
338338

339339
updateStrokeColorPlaceholder();

scripts/text.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Hooks.on("refreshDrawing", drawing => {
9595
dropShadowBlur: ts?.dropShadowBlur ?? Math.max(Math.round(document.fontSize / 16), 2),
9696
dropShadowColor: ts?.dropShadowColor || "#000000",
9797
dropShadowDistance: ts?.dropShadowDistance ?? 0,
98-
fill: ts?.fill?.length ? [document.textColor || "#FFFFFF"].concat(ts.fill.map(c => c || "#FFFFFF")) : document.textColor || "#FFFFFF",
98+
fill: ts?.fill?.length ? [document.textColor || "#ffffff"].concat(ts.fill.map(c => c || "#ffffff")) : document.textColor || "#ffffff",
9999
fillGradientStops: ts?.fillGradientStops ?? [],
100100
fillGradientType: ts?.fillGradientType ?? PIXI.TEXT_GRADIENT.LINEAR_VERTICAL,
101101
fontStyle: ts?.fontStyle || "normal",
@@ -104,7 +104,7 @@ Hooks.on("refreshDrawing", drawing => {
104104
leading: ts?.leading ?? 0,
105105
letterSpacing: ts?.letterSpacing ?? 0,
106106
lineJoin: "round",
107-
stroke: ts?.stroke || (Color.from(document.textColor || "#FFFFFF").hsv[2] > 0.6 ? 0x000000 : 0xFFFFFF),
107+
stroke: ts?.stroke || (Color.from(document.textColor || "#ffffff").hsv[2] > 0.6 ? 0x000000 : 0xFFFFFF),
108108
strokeThickness: ts?.strokeThickness ?? Math.max(Math.round(document.fontSize / 32), 2),
109109
wordWrapWidth: calculateValue(ts?.wordWrapWidth, document.shape.width) ?? document.shape.width
110110
});

0 commit comments

Comments
 (0)