diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-06-07 15:00:17 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-06-07 15:00:32 +0100 |
commit | ed30996f8fdae4f98d699c711c5b4c7b16e56888 (patch) | |
tree | 6f8ba9348f62645d1c9a9e6696d8f1b7927c7ec5 /cppcanvas | |
parent | ee1726bfdba483623d496a3bcc09089e8b55cd65 (diff) |
fdo#65502 - EmfFillPie fix.
Change-Id: I395ef5f5175b9a2d758f4023605b8e2d4dce859f
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/mtfrenderer/emfplus.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index dfc9b3177c97..14670a4ad6f1 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); |