diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-01-26 20:07:48 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-01-26 21:36:45 +0100 |
commit | 534fc16a9f8cd01bb88485e2cf6b9cd33aed3745 (patch) | |
tree | 60d3d8411bfdcf051525f3dc9a1a68d8c314d868 /vcl/quartz | |
parent | 60c30241ecb0caeab077a7fb7215442405c42506 (diff) |
make sure to not divide by zero when computing miter limit
The minimal angle is valid only if the line join style is miter,
and e.g. FileDefinitionWidgetDraw can call these with round join
style and 0 angle, which would divide by 0. So either clamp
the value or compute it only when needed.
Change-Id: I2a2c71481490c03ec6d01b8e33cab991400adb35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129006
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/AquaGraphicsBackend.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/quartz/AquaGraphicsBackend.cxx b/vcl/quartz/AquaGraphicsBackend.cxx index fdcbae1e3870..690cbf78ae9c 100644 --- a/vcl/quartz/AquaGraphicsBackend.cxx +++ b/vcl/quartz/AquaGraphicsBackend.cxx @@ -820,7 +820,7 @@ bool AquaGraphicsBackend::drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDev break; } // convert miter minimum angle to miter limit - CGFloat fCGMiterLimit = 1.0 / sin(fMiterMinimumAngle / 2.0); + CGFloat fCGMiterLimit = 1.0 / sin(std::min(fMiterMinimumAngle, 0.01 * M_PI) / 2.0); // setup cap attribute CGLineCap aCGLineCap(kCGLineCapButt); |