aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-20 16:56:21 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitc7fe842f9acf0eeec5453170699ed10394ef0fa5 (patch)
tree832b0f77d2d8ebd25ae10aa40d0fec728258e6b0
parent52503a2713432aab7663f88fd0be07055ee9125d (diff)
downloadscummvm-rg350-c7fe842f9acf0eeec5453170699ed10394ef0fa5.tar.gz
scummvm-rg350-c7fe842f9acf0eeec5453170699ed10394ef0fa5.tar.bz2
scummvm-rg350-c7fe842f9acf0eeec5453170699ed10394ef0fa5.zip
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.
-rw-r--r--gui/ThemeEngine.cpp5
1 files changed, 4 insertions, 1 deletions
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);