summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-04-23 16:24:17 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-04-24 10:46:31 +0200
commitc69d4edf61a2647ba8d6104c743e5f2d2cbc4229 (patch)
tree1b033c3bf152067dec4dcb18b7bf66d181410c50 /vcl
parent60bbff42643d0472fb358ea1b0d0123df113cdca (diff)
fix tick marks in Draw with Skia (tdf#132334)
Change-Id: I815fba5ae637a64fe381eb9e47632117bebfd81b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92790 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/skia/gdiimpl.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 378d51d1cf9f..2ffd68dee132 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -642,7 +642,11 @@ void SkiaSalGraphicsImpl::privateDrawAlphaRect(long nX, long nY, long nWidth, lo
{
paint.setColor(toSkColorWithTransparency(mLineColor, fTransparency));
paint.setStyle(SkPaint::kStroke_Style);
- canvas->drawIRect(SkIRect::MakeXYWH(nX, nY, nWidth - 1, nHeight - 1), paint);
+ // The obnoxious "-1 DrawRect()" hack that I don't understand the purpose of (and I'm not sure
+ // if anybody does), but without it some cases do not work. The max() is needed because Skia
+ // will not drawn anything if width or height is 0.
+ canvas->drawIRect(
+ SkIRect::MakeXYWH(nX, nY, std::max(1L, nWidth - 1), std::max(1L, nHeight - 1)), paint);
}
addXorRegion(SkRect::MakeXYWH(nX, nY, nWidth, nHeight));
postDraw();