From 711253bbfe936b9f8cfa48976ee34d75d2e48b3c Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 21 May 2022 20:22:47 +0300 Subject: [PATCH] Make sure ui::label shaping doesn't get stuck in infinite loop --- libs/ui/source/label.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/ui/source/label.cpp b/libs/ui/source/label.cpp index 538dd2ee..c1d10a93 100644 --- a/libs/ui/source/label.cpp +++ b/libs/ui/source/label.cpp @@ -234,6 +234,9 @@ namespace psemek::ui ++current_glyph; } + if (wrap_end && current_glyph == line_begin) + break; + if (wrap_end && current_glyph > line_begin) { std::size_t space_pos = current_glyph - 1;