diff options
author | Alexander Tkachev | 2016-07-20 16:56:21 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | c7fe842f9acf0eeec5453170699ed10394ef0fa5 (patch) | |
tree | 832b0f77d2d8ebd25ae10aa40d0fec728258e6b0 | |
parent | 52503a2713432aab7663f88fd0be07055ee9125d (diff) | |
download | scummvm-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.cpp | 5 |
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); |