[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - cppcanvas/source
Michael Meeks
michael.meeks at suse.com
Fri Jun 7 07:03:38 PDT 2013
cppcanvas/source/mtfrenderer/emfplus.cxx | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
New commits:
commit 768b77ef49d03864c4eca084d805169e01e67b22
Author: Michael Meeks <michael.meeks at suse.com>
Date: Fri Jun 7 15:00:17 2013 +0100
fdo#65502 - EmfFillPie fix.
Change-Id: I395ef5f5175b9a2d758f4023605b8e2d4dce859f
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 4cfd7b9..285b824 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1342,18 +1342,19 @@ 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);
- SAL_INFO("cppcanvas.emf", "EMF+ angles: " << startAngle << "," << sweepAngle << " ---> " << startAngle << "," << endAngle);
+ SAL_INFO("cppcanvas.emf", "EMF+ adjusted angles: start " <<
+ (360.0*startAngle/M_PI) << ", end: " << (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