diff options
-rw-r--r-- | graphics/VectorRendererSpec.cpp | 10 | ||||
-rw-r--r-- | graphics/VectorRendererSpec.h | 10 | ||||
-rw-r--r-- | gui/ThemeEngine.cpp | 12 |
3 files changed, 13 insertions, 19 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 8a471d522e..6281de7f63 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -2382,18 +2382,18 @@ drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int offset) { if (y + ystart < _clippingArea.top || y + ystart > _clippingArea.bottom) continue; if (((1 << x) & hb) == 0) { - blendFillClip(xstart + r + x, ptr_tl - y - px, ptr_tr + y - px, color, (uint8)alpha); + blendFill(ptr_tl - y - px, ptr_tr + y - px, color, (uint8)alpha); // Will create a dark line of pixles if left out if (hb > 0) { - blendFillClip(x, ptr_bl - y + px, ptr_br + y + px, color, (uint8)alpha); + blendFill(ptr_bl - y + px, ptr_br + y + px, color, (uint8)alpha); } hb |= (1 << x); } if (((1 << y) & hb) == 0) { - blendFillClip(x, ptr_tl - x - py, ptr_tr + x - py, color, (uint8)alpha); - blendFillClip(x, ptr_bl - x + py, ptr_br + x + py, color, (uint8)alpha); + blendFill(ptr_tl - x - py, ptr_tr + x - py, color, (uint8)alpha); + blendFill(ptr_bl - x + py, ptr_br + x + py, color, (uint8)alpha); hb |= (1 << y); } } @@ -2402,7 +2402,7 @@ drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int offset) { int realy = ystart; while (short_h--) { if (realy >= _clippingArea.top && realy <= _clippingArea.bottom) - blendFillClip(xstart+x, ptr_fill, ptr_fill + width + 1, color, (uint8)alpha); + blendFill(ptr_fill, ptr_fill + width + 1, color, (uint8)alpha); ptr_fill += pitch; ++realy; } diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h index 8a101b8e5a..8a7ce78cba 100644 --- a/graphics/VectorRendererSpec.h +++ b/graphics/VectorRendererSpec.h @@ -252,16 +252,6 @@ protected: } } - inline void blendFillClip(int x, PixelType *first, PixelType *last, PixelType color, uint8 alpha) { - while (first != last) { - if (x >= _clippingArea.left && x <= _clippingArea.right) - blendPixelPtr(first++, color, alpha); - else - ++first; - ++x; - } - } - void darkenFill(PixelType *first, PixelType *last); const PixelFormat _format; diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 037940dfd4..a38e565f6c 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -276,15 +276,19 @@ void ThemeItemDrawDataClip::drawSelf(bool draw, bool restore) { } void ThemeItemTextData::drawSelf(bool draw, bool restore) { + Common::Rect dirty = _textDrawableArea; + if (dirty.isEmpty()) dirty = _area; + else dirty.clip(_area); + if (_restoreBg || restore) - _engine->restoreBackground(_area); + _engine->restoreBackground(dirty); if (draw) { _engine->renderer()->setFgColor(_color->r, _color->g, _color->b); _engine->renderer()->drawString(_data->_fontPtr, _text, _area, _alignH, _alignV, _deltax, _ellipsis, _textDrawableArea); } - _engine->addDirtyRect(_area); + _engine->addDirtyRect(dirty); } void ThemeItemBitmap::drawSelf(bool draw, bool restore) { @@ -1414,12 +1418,12 @@ void ThemeEngine::drawTextClip(const Common::Rect &r, const Common::Rect &clippi switch (inverted) { case kTextInversion: - queueDD(kDDTextSelectionBackground, r); + queueDDClip(kDDTextSelectionBackground, r, clippingArea); restore = false; break; case kTextInversionFocus: - queueDD(kDDTextSelectionFocusBackground, r); + queueDDClip(kDDTextSelectionFocusBackground, r, clippingArea); restore = false; break; |