[PATCH libreoffice-4-0] fdo#65502 - EmfFillPie fix.
Michael Meeks (via Code Review)
gerrit at gerrit.libreoffice.org
Fri Jun 7 07:05:20 PDT 2013
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 at suse.com>
More information about the LibreOffice
mailing list