summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fde/cfde_path.cpp')
-rw-r--r--xfa/fde/cfde_path.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/xfa/fde/cfde_path.cpp b/xfa/fde/cfde_path.cpp
index 4afa718978..a7d2e47ac1 100644
--- a/xfa/fde/cfde_path.cpp
+++ b/xfa/fde/cfde_path.cpp
@@ -41,10 +41,9 @@ void CFDE_Path::ArcTo(bool bStart,
float ry = rect.height / 2;
float cx = rect.left + rx;
float cy = rect.top + ry;
- float alpha =
- FXSYS_atan2(rx * FXSYS_sin(startAngle), ry * FXSYS_cos(startAngle));
- float beta = FXSYS_atan2(rx * FXSYS_sin(endAngle), ry * FXSYS_cos(endAngle));
- if (FXSYS_fabs(beta - alpha) > FX_PI) {
+ float alpha = atan2(rx * sin(startAngle), ry * cos(startAngle));
+ float beta = atan2(rx * sin(endAngle), ry * cos(endAngle));
+ if (fabs(beta - alpha) > FX_PI) {
if (beta > alpha)
beta -= 2 * FX_PI;
else
@@ -52,11 +51,11 @@ void CFDE_Path::ArcTo(bool bStart,
}
float half_delta = (beta - alpha) / 2;
- float bcp = 4.0f / 3 * (1 - FXSYS_cos(half_delta)) / FXSYS_sin(half_delta);
- float sin_alpha = FXSYS_sin(alpha);
- float sin_beta = FXSYS_sin(beta);
- float cos_alpha = FXSYS_cos(alpha);
- float cos_beta = FXSYS_cos(beta);
+ float bcp = 4.0f / 3 * (1 - cos(half_delta)) / sin(half_delta);
+ float sin_alpha = sin(alpha);
+ float sin_beta = sin(beta);
+ float cos_alpha = cos(alpha);
+ float cos_beta = cos(beta);
if (bStart)
MoveTo(CFX_PointF(cx + rx * cos_alpha, cy + ry * sin_alpha));
@@ -154,8 +153,8 @@ void CFDE_Path::AddEllipse(const CFX_RectF& rect) {
void CFDE_Path::AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2) {
std::vector<FX_PATHPOINT>& points = m_Path.GetPoints();
- if (points.empty() || FXSYS_fabs(points.back().m_Point.x - pt1.x) > 0.001 ||
- FXSYS_fabs(points.back().m_Point.y - pt1.y) > 0.001) {
+ if (points.empty() || fabs(points.back().m_Point.x - pt1.x) > 0.001 ||
+ fabs(points.back().m_Point.y - pt1.y) > 0.001) {
MoveTo(pt1);
}
LineTo(pt2);
@@ -180,8 +179,8 @@ void CFDE_Path::AddPolygon(const std::vector<CFX_PointF>& points) {
AddLines(points);
const CFX_PointF* p = points.data();
- if (FXSYS_fabs(p[0].x - p[iCount - 1].x) < 0.01f ||
- FXSYS_fabs(p[0].y - p[iCount - 1].y) < 0.01f) {
+ if (fabs(p[0].x - p[iCount - 1].x) < 0.01f ||
+ fabs(p[0].y - p[iCount - 1].y) < 0.01f) {
LineTo(p[0]);
}
CloseFigure();