[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - cppcanvas/source
Michael Meeks
michael.meeks at suse.com
Fri Jun 7 07:28:59 PDT 2013
cppcanvas/source/mtfrenderer/emfplus.cxx | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 79c13d5d861d2884c6e0b386970d197d51a41211
Author: Michael Meeks <michael.meeks at suse.com>
Date: Fri Jun 7 14:45:59 2013 +0100
fdo#65502 - EmfFillPie fix.
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 4c74193..501ed01 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1293,18 +1293,18 @@ namespace cppcanvas
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) {
- double tmp = startAngle;
- startAngle = endAngle;
- endAngle = tmp;
- }
+ if (sweepAngle < 0)
+ std::swap (endAngle, startAngle);
- 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);
More information about the Libreoffice-commits
mailing list