summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2019-06-01 19:45:53 +0200
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2019-06-02 12:13:56 +0200
commit93477d1a963e38e3319013e43835a8ffef200972 (patch)
treef94d3c702dfabd6b51e9acfb823e58dfbf17ce27
parent88f48b51f3cf25c78db278499d46d4913ab442ed (diff)
tdf#125506: use rObjectToDevice if needed
Use same logic as in vcl/unx/generic/gdi/gdiimpl.cxx Regression from 16091ff88aaab9ba9103c4e369bf79b97f431f40 See https://bugs.documentfoundation.org/show_bug.cgi?id=125506#c13 Thanks to Thorsten Wagner for pinpointing Change-Id: I7a7a8c4b3355f5621ba1603939a3757cd03e7777 Reviewed-on: https://gerrit.libreoffice.org/73319 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
-rw-r--r--vcl/quartz/salgdicommon.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 913d2ac43f19..333c23c93035 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -874,10 +874,15 @@ bool AquaSalGraphics::drawPolyLine(
return false;
#endif
+ // need to check/handle LineWidth when ObjectToDevice transformation is used
+ const basegfx::B2DVector aDeviceLineWidths(rObjectToDevice * rLineWidths);
+ const bool bCorrectLineWidth(aDeviceLineWidths.getX() < 1.0 && rLineWidths.getX() >= 1.0);
+ const basegfx::B2DVector aLineWidths(bCorrectLineWidth ? rLineWidths : aDeviceLineWidths);
+
// #i101491# Aqua does not support B2DLineJoin::NONE; return false to use
// the fallback (own geometry preparation)
// #i104886# linejoin-mode and thus the above only applies to "fat" lines
- if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (rLineWidths.getX() > 1.3) )
+ if( (basegfx::B2DLineJoin::NONE == eLineJoin) && (aLineWidths.getX() > 1.3) )
return false;
// Transform to DeviceCoordinates, get DeviceLineWidth, execute PixelSnapHairline
@@ -946,7 +951,7 @@ bool AquaSalGraphics::drawPolyLine(
CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency );
CGContextSetLineJoin( maContextHolder.get(), aCGLineJoin );
CGContextSetLineCap( maContextHolder.get(), aCGLineCap );
- CGContextSetLineWidth( maContextHolder.get(), rLineWidths.getX() );
+ CGContextSetLineWidth( maContextHolder.get(), aLineWidths.getX() );
CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit);
SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << ",kCGPathStroke)" );
CGContextDrawPath( maContextHolder.get(), kCGPathStroke );