From 5a45ccf70dba13b0c56739220697b3597481ac87 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 28 May 2023 16:55:47 +0200 Subject: [PATCH 1/2] Fix text formatting infinite loop #1127 --- Source/Engine/Render2D/Font.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Render2D/Font.cpp b/Source/Engine/Render2D/Font.cpp index c36f40515..f12a9ce1c 100644 --- a/Source/Engine/Render2D/Font.cpp +++ b/Source/Engine/Render2D/Font.cpp @@ -178,7 +178,8 @@ void Font::ProcessText(const StringView& text, Array& outputLines if (lastWrapCharIndex != INVALID_INDEX) { // Skip moving twice for the same character - if (outputLines.HasItems() && outputLines.Last().LastCharIndex == lastWrapCharIndex - 1) + int32 lastLineLasCharIndex = outputLines.HasItems() ? outputLines.Last().LastCharIndex : -10000; + if (lastLineLasCharIndex == lastWrapCharIndex || lastLineLasCharIndex == lastWrapCharIndex - 1 || lastLineLasCharIndex == lastWrapCharIndex - 2) { currentIndex = nextCharIndex; lastMoveLine = moveLine; From b65c84c02e4d884b10d3accbb88b8e67c20d44a1 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 28 May 2023 16:57:38 +0200 Subject: [PATCH 2/2] Fix compilation issue from 62946f63598ae501bd3c217dc7b602a280a44d35 --- Source/Editor/Utilities/ScreenUtilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Utilities/ScreenUtilities.cpp b/Source/Editor/Utilities/ScreenUtilities.cpp index cff41f7bf..44f52350e 100644 --- a/Source/Editor/Utilities/ScreenUtilities.cpp +++ b/Source/Editor/Utilities/ScreenUtilities.cpp @@ -63,7 +63,7 @@ Color32 ScreenUtilities::GetColorAt(const Float2& pos) int defaultScreen = X11::XDefaultScreen(display); X11::XImage* image; - image = X11::XGetImage(display, X11::XRootWindow(display, defaultScreen), x, y, 1, 1, AllPlanes, XYPixmap); + image = X11::XGetImage(display, X11::XRootWindow(display, defaultScreen), (int)pos.X, (int)pos.Y, 1, 1, AllPlanes, XYPixmap); color.pixel = XGetPixel(image, 0, 0); X11::XFree(image);