From 0bbfe624be0b7fb01a1e94f37e00b9a448651f7f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 24 Nov 2019 15:55:11 +0100 Subject: [PATCH] MACGUI: Do not recalc empty text --- graphics/macgui/mactext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 9a5de39dd25..1c80e553581 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -295,6 +295,9 @@ void MacText::render() { } void MacText::render(int from, int to) { + if (_textLines.empty()) + return; + reallocSurface(); from = MAX(0, from); @@ -373,6 +376,9 @@ void MacText::setInterLinear(int interLinear) { } void MacText::recalcDims() { + if (_textLines.empty()) + return; + int y = 0; _textMaxWidth = 0;