From 08ca753d09b0670c879766af1acaf40a8b673419 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sun, 10 Sep 2023 19:22:57 +0100 Subject: [PATCH] fix new lines --- web/js/workflowImage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/js/workflowImage.js b/web/js/workflowImage.js index 2820ec2..0158f65 100644 --- a/web/js/workflowImage.js +++ b/web/js/workflowImage.js @@ -561,7 +561,13 @@ app.registerExtension({ ctx.fillStyle = style.getPropertyValue("color"); ctx.font = style.getPropertyValue("font"); - wrapText(ctx, this.inputEl.value, x, y + t.d * 12, w, t.d * 12); + const line = t.d * 12; + const split = this.inputEl.value.split("\n"); + let start = y; + for (const l of split) { + start += line; + wrapText(ctx, l, x + 4, start, w, line); + } ctx.restore(); }