diff options
Diffstat (limited to 'xfa/fde')
-rw-r--r-- | xfa/fde/cfde_path.cpp | 25 | ||||
-rw-r--r-- | xfa/fde/cfde_renderdevice.cpp | 7 | ||||
-rw-r--r-- | xfa/fde/cfde_txtedtengine.cpp | 3 | ||||
-rw-r--r-- | xfa/fde/css/cfde_cssnumbervalue.cpp | 2 |
4 files changed, 17 insertions, 20 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(); diff --git a/xfa/fde/cfde_renderdevice.cpp b/xfa/fde/cfde_renderdevice.cpp index d3456e17cb..6f2431737b 100644 --- a/xfa/fde/cfde_renderdevice.cpp +++ b/xfa/fde/cfde_renderdevice.cpp @@ -57,10 +57,9 @@ void CFDE_RenderDevice::RestoreState() { bool CFDE_RenderDevice::SetClipRect(const CFX_RectF& rtClip) { m_rtClip = rtClip; - return m_pDevice->SetClip_Rect(FX_RECT((int32_t)FXSYS_floor(rtClip.left), - (int32_t)FXSYS_floor(rtClip.top), - (int32_t)FXSYS_ceil(rtClip.right()), - (int32_t)FXSYS_ceil(rtClip.bottom()))); + return m_pDevice->SetClip_Rect( + FX_RECT((int32_t)floor(rtClip.left), (int32_t)floor(rtClip.top), + (int32_t)ceil(rtClip.right()), (int32_t)ceil(rtClip.bottom()))); } const CFX_RectF& CFDE_RenderDevice::GetClipRect() { diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index 15edfc1c1c..37e3e118d1 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -283,8 +283,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret, break; } if (bShift && m_nAnchorPos != -1 && (m_nAnchorPos != m_nCaret)) { - AddSelRange(std::min(m_nAnchorPos, m_nCaret), - FXSYS_abs(m_nAnchorPos - m_nCaret)); + AddSelRange(std::min(m_nAnchorPos, m_nCaret), abs(m_nAnchorPos - m_nCaret)); m_Param.pEventSink->OnSelChanged(); } if (bSelChange) diff --git a/xfa/fde/css/cfde_cssnumbervalue.cpp b/xfa/fde/css/cfde_cssnumbervalue.cpp index e74ca5b859..45a9c917b1 100644 --- a/xfa/fde/css/cfde_cssnumbervalue.cpp +++ b/xfa/fde/css/cfde_cssnumbervalue.cpp @@ -8,7 +8,7 @@ CFDE_CSSNumberValue::CFDE_CSSNumberValue(FDE_CSSNumberType type, float value) : CFDE_CSSValue(FDE_CSSPrimitiveType::Number), type_(type), value_(value) { - if (type_ == FDE_CSSNumberType::Number && FXSYS_fabs(value_) < 0.001f) + if (type_ == FDE_CSSNumberType::Number && fabs(value_) < 0.001f) value_ = 0.0f; } |