From 47d3d2ecea3178f081789be4941eae34266e01ac Mon Sep 17 00:00:00 2001 From: Sync1211 Date: Wed, 18 May 2022 20:31:03 +0200 Subject: [PATCH] * Fixed wrap_by_space not working correctly when given a word that is too long for the canvas --- www/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/main.js b/www/main.js index 72c14f1..cd0d344 100644 --- a/www/main.js +++ b/www/main.js @@ -468,7 +468,7 @@ class CanvasController { const wrap_by_space = (text, max_length) => { let split_pos = text.lastIndexOf(" ", max_length); - if (split_pos == 0) { split_pos = max_length; } + if (split_pos <= 0) { split_pos = max_length; } return [text.slice(0, split_pos).trim(), text.slice(split_pos, text.length).trim()]; }