Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4189

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/89/4189/1

fdo#65502 - EmfFillPie fix.

Change-Id: Ic52ae70c7879de93029ecfd8b3de85c5fbcfa9eb
---
M cppcanvas/source/mtfrenderer/emfplus.cxx
1 file changed, 9 insertions(+), 9 deletions(-)



diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 4282c47..a3de9b6 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1298,18 +1298,18 @@
                         B2DPoint mappedCenter (Map (dx + dw/2, dy + dh/2));
                         B2DSize mappedSize( MapSize (dw/2, dh/2));
 
-                        double endAngle = startAngle + sweepAngle;
+                        float endAngle = startAngle + sweepAngle;
+                        startAngle = fmod (startAngle, M_PI*2);
+                        if (startAngle < 0)
+                            startAngle += M_PI*2;
+                        endAngle = fmod (endAngle, M_PI*2);
                         if (endAngle < 0)
                             endAngle += M_PI*2;
-                        endAngle = fmod (endAngle, M_PI*2);
+                        if (sweepAngle < 0)
+                            std::swap (endAngle, startAngle);
 
-                        if (sweepAngle < 0) {
-                            double tmp = startAngle;
-                            startAngle = endAngle;
-                            endAngle = tmp;
-                        }
-
-                        EMFP_DEBUG (printf ("EMF+ angles: %f,%f  ---> %f,%f\n", startAngle, 
sweepAngle, startAngle, endAngle));
+                        EMFP_DEBUG (printf ("EMF+ adjusted angles to: %f,%f\n",
+                                            360.0*startAngle/M_PI, 360.0*endAngle/M_PI));
 
                         B2DPolygon polygon = tools::createPolygonFromEllipseSegment (mappedCenter, 
mappedSize.getX (), mappedSize.getY (), startAngle, endAngle);
                         polygon.append (mappedCenter);

-- 
To view, visit https://gerrit.libreoffice.org/4189
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic52ae70c7879de93029ecfd8b3de85c5fbcfa9eb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Michael Meeks <michael.meeks@suse.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.