From c7fe842f9acf0eeec5453170699ed10394ef0fa5 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 20 Jul 2016 16:56:21 +0600 Subject: GUI: Fix texts clipping If it was completely clipped out (empty rectangle), it was drawing the whole text ("empty means no clipping"), so I had to detect such cases and change textArea to one small pixel. --- gui/ThemeEngine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index e0563da711..78353a05de 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -1088,7 +1088,10 @@ void ThemeEngine::queueDDTextClip(TextData type, TextColor color, const Common:: area.clip(_screen.w, _screen.h); Common::Rect textArea = drawableTextArea; if (textArea.isEmpty()) textArea = clippingArea; - else textArea.clip(clippingArea); + else { + textArea.clip(clippingArea); + if (textArea.isEmpty()) textArea = Common::Rect(0, 0, 1, 1); // one small pixel should be invisible enough + } ThemeItemTextData *q = new ThemeItemTextData(this, _texts[type], _textColors[color], area, textArea, text, alignH, alignV, ellipsis, restoreBg, deltax); -- cgit v1.2.3