tdf#125506 tdf#121241: only use rObjectToDevice if needed

Use same logic as in vcl/unx/generic/gdi/gdiimpl.cxx

Reviewed-on: https://gerrit.libreoffice.org/73319
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
(cherry picked from commit 93477d1a963e38e3319013e43835a8ffef200972)
Reviewed-on: https://gerrit.libreoffice.org/73328

Change-Id: I7a7a8c4b3355f5621ba1603939a3757cd03e7777
Reviewed-on: https://gerrit.libreoffice.org/73396
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 2e22d60..aaed9261 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -864,8 +864,10 @@
        return false;
#endif

    // Transform to DeviceCoordinates, get DeviceLineWidth, execute PixelSnapHairline
    const basegfx::B2DVector aLineWidths(rObjectToDevice * rLineWidths);
    // 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)