From 3d2730a0ddd1e1e33e6639775727beb954d7bfc0 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 21 Jun 2016 16:45:07 +0600 Subject: GUI: clippingRect propagated deeper --- graphics/VectorRendererSpec.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'graphics/VectorRendererSpec.cpp') diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 258d935440..6c559e0f70 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -918,6 +918,29 @@ drawRoundedSquare(int x, int y, int r, int w, int h) { drawRoundedSquareAlg(x, y, r, w, h, _fgColor, Base::_fillMode); } +template +void VectorRendererSpec:: +drawRoundedSquareClip(int x, int y, int r, int w, int h, int cx, int cy, int cw, int ch) { + if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h || + w <= 0 || h <= 0 || x < 0 || y < 0 || r <= 0) + return; + + if ((r * 2) > w || (r * 2) > h) + r = MIN(w / 2, h / 2); + + if (r <= 0) + return; + + if (Base::_fillMode != kFillDisabled && Base::_shadowOffset + && x + w + Base::_shadowOffset + 1 < Base::_activeSurface->w + && y + h + Base::_shadowOffset + 1 < Base::_activeSurface->h + && h > (Base::_shadowOffset + 1) * 2) { + drawRoundedSquareShadow(x, y, r, w, h, Base::_shadowOffset); + } + + drawRoundedSquareAlg(x, y, r, w, h, _fgColor, Base::_fillMode); +} + template void VectorRendererSpec:: drawTab(int x, int y, int r, int w, int h) { -- cgit v1.2.3