summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGPathParser.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/svg/SVGPathParser.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/svg/SVGPathParser.cpp')
-rw-r--r--Source/WebCore/svg/SVGPathParser.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/WebCore/svg/SVGPathParser.cpp b/Source/WebCore/svg/SVGPathParser.cpp
index dc4892aab..199a92da0 100644
--- a/Source/WebCore/svg/SVGPathParser.cpp
+++ b/Source/WebCore/svg/SVGPathParser.cpp
@@ -27,6 +27,7 @@
#include "SVGPathParser.h"
#include "AffineTransform.h"
+#include "SVGPathSource.h"
#include <wtf/MathExtras.h>
static const float gOneOverThree = 1 / 3.f;
@@ -448,11 +449,12 @@ bool SVGPathParser::decomposeArcToCubic(float angle, float rx, float ry, FloatPo
scaleFactor = -scaleFactor;
delta.scale(scaleFactor);
- FloatPoint centerPoint = FloatPoint(0.5f * (point1.x() + point2.x()) - delta.height(),
- 0.5f * (point1.y() + point2.y()) + delta.width());
+ FloatPoint centerPoint = point1 + point2;
+ centerPoint.scale(0.5f, 0.5f);
+ centerPoint.move(-delta.height(), delta.width());
- float theta1 = atan2f(point1.y() - centerPoint.y(), point1.x() - centerPoint.x());
- float theta2 = atan2f(point2.y() - centerPoint.y(), point2.x() - centerPoint.x());
+ float theta1 = FloatPoint(point1 - centerPoint).slopeAngleRadians();
+ float theta2 = FloatPoint(point2 - centerPoint).slopeAngleRadians();
float thetaArc = theta2 - theta1;
if (thetaArc < 0 && sweepFlag)
@@ -472,7 +474,7 @@ bool SVGPathParser::decomposeArcToCubic(float angle, float rx, float ry, FloatPo
float endTheta = theta1 + (i + 1) * thetaArc / segments;
float t = (8 / 6.f) * tanf(0.25f * (endTheta - startTheta));
- if (!isfinite(t))
+ if (!std::isfinite(t))
return false;
float sinStartTheta = sinf(startTheta);
float cosStartTheta = cosf(startTheta);