summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-03-25 09:40:51 +0200
committerTor Lillqvist <tml@collabora.com>2020-03-25 19:36:56 +0100
commit77638038470a93d30a82f2ece86b89eda82696f9 (patch)
tree45e03d1a9da3808ba50eca38f6f398f073326172 /vcl/quartz
parentf1959c4414b3f50c8bdf9fd87fb0501523b08535 (diff)
Avoid CGContextSetLineWidth warning about negative line width
Change-Id: I82d37d0277e324e269674ed40592026e0097fa33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91027 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91031 Tested-by: Jenkins
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/salgdicommon.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 4ca5eede4578..6489b33d1fd9 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -935,7 +935,12 @@ bool AquaSalGraphics::drawPolyLine(
CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency );
CGContextSetLineJoin( maContextHolder.get(), aCGLineJoin );
CGContextSetLineCap( maContextHolder.get(), aCGLineCap );
- CGContextSetLineWidth( maContextHolder.get(), aLineWidth.getX() );
+
+ // aLineWidth.getX() can be negative here. That causes a warning that shows up in the debugger.
+ if (aLineWidth.getX() > 0)
+ {
+ CGContextSetLineWidth( maContextHolder.get(), aLineWidth.getX() );
+ }
CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit);
CGContextDrawPath( maContextHolder.get(), kCGPathStroke );
maContextHolder.restoreState();