[Libreoffice-commits] core.git: vcl/skia
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 24 08:47:19 UTC 2020
vcl/skia/gdiimpl.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit c69d4edf61a2647ba8d6104c743e5f2d2cbc4229
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Thu Apr 23 16:24:17 2020 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Fri Apr 24 10:46:31 2020 +0200
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 at collabora.com>
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();
More information about the Libreoffice-commits
mailing list