diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-02-22 19:56:15 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-23 01:17:40 +0000 |
commit | b147e07ee36be10ca0796a6566be107077c21a03 (patch) | |
tree | 637b1b206000a88fb3e198f648e86a9ee5178f1b /fpdfsdk | |
parent | e3f237740fd8bea50b4a6f37f56455dfa0328546 (diff) | |
download | pdfium-b147e07ee36be10ca0796a6566be107077c21a03.tar.xz |
Convert point x,y into CFX_PointF
This Cl converts the PointX,PointY pairs into a CFX_PointF.
Change-Id: I46897832077c317a5bffb4e568550705decbc40c
Reviewed-on: https://pdfium-review.googlesource.com/2821
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 18 | ||||
-rw-r--r-- | fpdfsdk/fpdf_transformpage.cpp | 26 | ||||
-rw-r--r-- | fpdfsdk/fpdfeditpath.cpp | 12 | ||||
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Caret.cpp | 18 | ||||
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_ComboBox.cpp | 8 | ||||
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Edit.cpp | 32 | ||||
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_ScrollBar.cpp | 16 | ||||
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Utils.cpp | 98 |
8 files changed, 123 insertions, 105 deletions
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index 01d12c1687..a830d529cb 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -69,14 +69,16 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView, CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) { CFX_PathData path; - path.AppendPoint(rcFocus.left, rcFocus.top, FXPT_TYPE::MoveTo, false); - path.AppendPoint(rcFocus.left, rcFocus.bottom, FXPT_TYPE::LineTo, - false); - path.AppendPoint(rcFocus.right, rcFocus.bottom, FXPT_TYPE::LineTo, - false); - path.AppendPoint(rcFocus.right, rcFocus.top, FXPT_TYPE::LineTo, - false); - path.AppendPoint(rcFocus.left, rcFocus.top, FXPT_TYPE::LineTo, false); + path.AppendPoint(CFX_PointF(rcFocus.left, rcFocus.top), + FXPT_TYPE::MoveTo, false); + path.AppendPoint(CFX_PointF(rcFocus.left, rcFocus.bottom), + FXPT_TYPE::LineTo, false); + path.AppendPoint(CFX_PointF(rcFocus.right, rcFocus.bottom), + FXPT_TYPE::LineTo, false); + path.AppendPoint(CFX_PointF(rcFocus.right, rcFocus.top), + FXPT_TYPE::LineTo, false); + path.AppendPoint(CFX_PointF(rcFocus.left, rcFocus.top), + FXPT_TYPE::LineTo, false); CFX_GraphStateData gsd; gsd.SetDashCount(1); diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp index 7e19505c26..3427f4ea58 100644 --- a/fpdfsdk/fpdf_transformpage.cpp +++ b/fpdfsdk/fpdf_transformpage.cpp @@ -239,32 +239,32 @@ void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) { const std::vector<FX_PATHPOINT>& pPoints = pPathData->GetPoints(); if (path.IsRect()) { - buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " " - << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " " - << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n"; + CFX_PointF diff = pPoints[2].m_Point - pPoints[0].m_Point; + buf << pPoints[0].m_Point.x << " " << pPoints[0].m_Point.y << " " << diff.x + << " " << diff.y << " re\n"; return; } CFX_ByteString temp; for (size_t i = 0; i < pPoints.size(); i++) { - buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY); + buf << pPoints[i].m_Point.x << " " << pPoints[i].m_Point.y; FXPT_TYPE point_type = pPoints[i].m_Type; if (point_type == FXPT_TYPE::MoveTo) { buf << " m\n"; } else if (point_type == FXPT_TYPE::BezierTo) { - buf << " " << (pPoints[i + 1].m_PointX) << " " - << (pPoints[i + 1].m_PointY) << " " << (pPoints[i + 2].m_PointX) - << " " << (pPoints[i + 2].m_PointY); + buf << " " << pPoints[i + 1].m_Point.x << " " << pPoints[i + 1].m_Point.y + << " " << pPoints[i + 2].m_Point.x << " " << pPoints[i + 2].m_Point.y; + buf << " c"; if (pPoints[i + 2].m_CloseFigure) - buf << " c h\n"; - else - buf << " c\n"; + buf << " h"; + buf << "\n"; + i += 2; } else if (point_type == FXPT_TYPE::LineTo) { + buf << " l"; if (pPoints[i].m_CloseFigure) - buf << " l h\n"; - else - buf << " l\n"; + buf << " h"; + buf << "\n"; } } } diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp index 63a887dc85..074f083bb1 100644 --- a/fpdfsdk/fpdfeditpath.cpp +++ b/fpdfsdk/fpdfeditpath.cpp @@ -10,7 +10,7 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y) { CPDF_PathObject* pPathObj = new CPDF_PathObject; - pPathObj->m_Path.AppendPoint(x, y, FXPT_TYPE::MoveTo, false); + pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false); pPathObj->DefaultStates(); return pPathObj; } @@ -71,7 +71,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_MoveTo(FPDF_PAGEOBJECT path, float x, float y) { return false; auto pPathObj = reinterpret_cast<CPDF_PathObject*>(path); - pPathObj->m_Path.AppendPoint(x, y, FXPT_TYPE::MoveTo, false); + pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false); return true; } @@ -80,7 +80,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_LineTo(FPDF_PAGEOBJECT path, float x, float y) { return false; auto pPathObj = reinterpret_cast<CPDF_PathObject*>(path); - pPathObj->m_Path.AppendPoint(x, y, FXPT_TYPE::LineTo, false); + pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::LineTo, false); return true; } @@ -95,9 +95,9 @@ DLLEXPORT FPDF_BOOL FPDFPath_BezierTo(FPDF_PAGEOBJECT path, return false; auto pPathObj = reinterpret_cast<CPDF_PathObject*>(path); - pPathObj->m_Path.AppendPoint(x1, y1, FXPT_TYPE::BezierTo, false); - pPathObj->m_Path.AppendPoint(x2, y2, FXPT_TYPE::BezierTo, false); - pPathObj->m_Path.AppendPoint(x3, y3, FXPT_TYPE::BezierTo, false); + pPathObj->m_Path.AppendPoint(CFX_PointF(x1, y1), FXPT_TYPE::BezierTo, false); + pPathObj->m_Path.AppendPoint(CFX_PointF(x2, y2), FXPT_TYPE::BezierTo, false); + pPathObj->m_Path.AppendPoint(CFX_PointF(x3, y3), FXPT_TYPE::BezierTo, false); return true; } diff --git a/fpdfsdk/pdfwindow/PWL_Caret.cpp b/fpdfsdk/pdfwindow/PWL_Caret.cpp index e263a79065..3360bbf62a 100644 --- a/fpdfsdk/pdfwindow/PWL_Caret.cpp +++ b/fpdfsdk/pdfwindow/PWL_Caret.cpp @@ -40,19 +40,17 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, FX_FLOAT fCaretBottom = rcRect.bottom; if (!rcClip.IsEmpty()) { rcRect.Intersect(rcClip); - if (!rcRect.IsEmpty()) { - fCaretTop = rcRect.top; - fCaretBottom = rcRect.bottom; - path.AppendPoint(fCaretX, fCaretBottom, FXPT_TYPE::MoveTo, false); - path.AppendPoint(fCaretX, fCaretTop, FXPT_TYPE::LineTo, false); - } else { + if (rcRect.IsEmpty()) return; - } - } else { - path.AppendPoint(fCaretX, fCaretBottom, FXPT_TYPE::MoveTo, false); - path.AppendPoint(fCaretX, fCaretTop, FXPT_TYPE::LineTo, false); + + fCaretTop = rcRect.top; + fCaretBottom = rcRect.bottom; } + path.AppendPoint(CFX_PointF(fCaretX, fCaretBottom), FXPT_TYPE::MoveTo, + false); + path.AppendPoint(CFX_PointF(fCaretX, fCaretTop), FXPT_TYPE::LineTo, false); + CFX_GraphStateData gsd; gsd.m_LineWidth = m_fWidth; pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255, 0, 0, 0), diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp index adab4e7998..b9e96b2bf1 100644 --- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp @@ -147,10 +147,10 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, IsFloatBigger(rectWnd.top - rectWnd.bottom, PWL_CBBUTTON_TRIANGLE_HALFLEN)) { CFX_PathData path; - path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::MoveTo, false); - path.AppendPoint(pt2.x, pt2.y, FXPT_TYPE::LineTo, false); - path.AppendPoint(pt3.x, pt3.y, FXPT_TYPE::LineTo, false); - path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt1, FXPT_TYPE::MoveTo, false); + path.AppendPoint(pt2, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt3, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt1, FXPT_TYPE::LineTo, false); pDevice->DrawPath(&path, pUser2Device, nullptr, CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR, diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp index 5c22d21940..4aa3d927d7 100644 --- a/fpdfsdk/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp @@ -326,13 +326,17 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, for (int32_t i = 0; i < nCharArray - 1; i++) { path.AppendPoint( - rcClient.left + - ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), - rcClient.bottom, FXPT_TYPE::MoveTo, false); + CFX_PointF( + rcClient.left + + ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), + rcClient.bottom), + FXPT_TYPE::MoveTo, false); path.AppendPoint( - rcClient.left + - ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), - rcClient.top, FXPT_TYPE::LineTo, false); + CFX_PointF( + rcClient.left + + ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), + rcClient.top), + FXPT_TYPE::LineTo, false); } if (!path.GetPoints().empty()) { pDevice->DrawPath( @@ -354,13 +358,17 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_PathData path; for (int32_t i = 0; i < nCharArray - 1; i++) { path.AppendPoint( - rcClient.left + - ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), - rcClient.bottom, FXPT_TYPE::MoveTo, false); + CFX_PointF( + rcClient.left + + ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), + rcClient.bottom), + FXPT_TYPE::MoveTo, false); path.AppendPoint( - rcClient.left + - ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), - rcClient.top, FXPT_TYPE::LineTo, false); + CFX_PointF( + rcClient.left + + ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), + rcClient.top), + FXPT_TYPE::LineTo, false); } if (!path.GetPoints().empty()) { pDevice->DrawPath( diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp index 652c8e1f45..23bd753761 100644 --- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp +++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp @@ -257,10 +257,10 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { CFX_PathData path; - path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::MoveTo, false); - path.AppendPoint(pt2.x, pt2.y, FXPT_TYPE::LineTo, false); - path.AppendPoint(pt3.x, pt3.y, FXPT_TYPE::LineTo, false); - path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt1, FXPT_TYPE::MoveTo, false); + path.AppendPoint(pt2, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt3, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt1, FXPT_TYPE::LineTo, false); pDevice->DrawPath(&path, pUser2Device, nullptr, CPWL_Utils::PWLColorToFXColor( @@ -278,10 +278,10 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { CFX_PathData path; - path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::MoveTo, false); - path.AppendPoint(pt2.x, pt2.y, FXPT_TYPE::LineTo, false); - path.AppendPoint(pt3.x, pt3.y, FXPT_TYPE::LineTo, false); - path.AppendPoint(pt1.x, pt1.y, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt1, FXPT_TYPE::MoveTo, false); + path.AppendPoint(pt2, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt3, FXPT_TYPE::LineTo, false); + path.AppendPoint(pt1, FXPT_TYPE::LineTo, false); pDevice->DrawPath(&path, pUser2Device, nullptr, CPWL_Utils::PWLColorToFXColor( diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp index 9f5e31f6fd..54e75db8fe 100644 --- a/fpdfsdk/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp @@ -51,16 +51,13 @@ void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, for (int32_t i = 0; i < nCount; i++) { switch (pPathData[i].type) { case PWLPT_MOVETO: - path.AppendPoint(pPathData[i].point.x, pPathData[i].point.y, - FXPT_TYPE::MoveTo, false); + path.AppendPoint(pPathData[i].point, FXPT_TYPE::MoveTo, false); break; case PWLPT_LINETO: - path.AppendPoint(pPathData[i].point.x, pPathData[i].point.y, - FXPT_TYPE::LineTo, false); + path.AppendPoint(pPathData[i].point, FXPT_TYPE::LineTo, false); break; case PWLPT_BEZIERTO: - path.AppendPoint(pPathData[i].point.x, pPathData[i].point.y, - FXPT_TYPE::BezierTo, false); + path.AppendPoint(pPathData[i].point, FXPT_TYPE::BezierTo, false); break; default: break; @@ -1232,9 +1229,9 @@ void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, int32_t nCount, const FX_COLORREF& color) { CFX_PathData path; - path.AppendPoint(pPts[0].x, pPts[0].y, FXPT_TYPE::MoveTo, false); + path.AppendPoint(pPts[0], FXPT_TYPE::MoveTo, false); for (int32_t i = 1; i < nCount; i++) - path.AppendPoint(pPts[i].x, pPts[i].y, FXPT_TYPE::LineTo, false); + path.AppendPoint(pPts[i], FXPT_TYPE::LineTo, false); pDevice->DrawPath(&path, pUser2Device, nullptr, color, 0, FXFILL_ALTERNATE); } @@ -1261,8 +1258,8 @@ void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, const FX_COLORREF& color, FX_FLOAT fWidth) { CFX_PathData path; - path.AppendPoint(ptMoveTo.x, ptMoveTo.y, FXPT_TYPE::MoveTo, false); - path.AppendPoint(ptLineTo.x, ptLineTo.y, FXPT_TYPE::LineTo, false); + path.AppendPoint(ptMoveTo, FXPT_TYPE::MoveTo, false); + path.AppendPoint(ptLineTo, FXPT_TYPE::LineTo, false); CFX_GraphStateData gsd; gsd.m_LineWidth = fWidth; @@ -1345,16 +1342,21 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, } case BorderStyle::DASH: { CFX_PathData path; - path.AppendPoint(fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, - FXPT_TYPE::MoveTo, false); - path.AppendPoint(fLeft + fWidth / 2.0f, fTop - fWidth / 2.0f, - FXPT_TYPE::LineTo, false); - path.AppendPoint(fRight - fWidth / 2.0f, fTop - fWidth / 2.0f, - FXPT_TYPE::LineTo, false); - path.AppendPoint(fRight - fWidth / 2.0f, fBottom + fWidth / 2.0f, - FXPT_TYPE::LineTo, false); - path.AppendPoint(fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, - FXPT_TYPE::LineTo, false); + path.AppendPoint( + CFX_PointF(fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f), + FXPT_TYPE::MoveTo, false); + path.AppendPoint( + CFX_PointF(fLeft + fWidth / 2.0f, fTop - fWidth / 2.0f), + FXPT_TYPE::LineTo, false); + path.AppendPoint( + CFX_PointF(fRight - fWidth / 2.0f, fTop - fWidth / 2.0f), + FXPT_TYPE::LineTo, false); + path.AppendPoint( + CFX_PointF(fRight - fWidth / 2.0f, fBottom + fWidth / 2.0f), + FXPT_TYPE::LineTo, false); + path.AppendPoint( + CFX_PointF(fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f), + FXPT_TYPE::LineTo, false); CFX_GraphStateData gsd; gsd.SetDashCount(2); @@ -1375,19 +1377,22 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CFX_PathData pathLT; - pathLT.AppendPoint(fLeft + fHalfWidth, fBottom + fHalfWidth, + pathLT.AppendPoint(CFX_PointF(fLeft + fHalfWidth, fBottom + fHalfWidth), FXPT_TYPE::MoveTo, false); - pathLT.AppendPoint(fLeft + fHalfWidth, fTop - fHalfWidth, - FXPT_TYPE::LineTo, false); - pathLT.AppendPoint(fRight - fHalfWidth, fTop - fHalfWidth, + pathLT.AppendPoint(CFX_PointF(fLeft + fHalfWidth, fTop - fHalfWidth), FXPT_TYPE::LineTo, false); - pathLT.AppendPoint(fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, + pathLT.AppendPoint(CFX_PointF(fRight - fHalfWidth, fTop - fHalfWidth), FXPT_TYPE::LineTo, false); - pathLT.AppendPoint(fLeft + fHalfWidth * 2, fTop - fHalfWidth * 2, - FXPT_TYPE::LineTo, false); - pathLT.AppendPoint(fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, - FXPT_TYPE::LineTo, false); - pathLT.AppendPoint(fLeft + fHalfWidth, fBottom + fHalfWidth, + pathLT.AppendPoint( + CFX_PointF(fRight - fHalfWidth * 2, fTop - fHalfWidth * 2), + FXPT_TYPE::LineTo, false); + pathLT.AppendPoint( + CFX_PointF(fLeft + fHalfWidth * 2, fTop - fHalfWidth * 2), + FXPT_TYPE::LineTo, false); + pathLT.AppendPoint( + CFX_PointF(fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2), + FXPT_TYPE::LineTo, false); + pathLT.AppendPoint(CFX_PointF(fLeft + fHalfWidth, fBottom + fHalfWidth), FXPT_TYPE::LineTo, false); pDevice->DrawPath(&pathLT, pUser2Device, &gsd, @@ -1395,19 +1400,23 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, FXFILL_ALTERNATE); CFX_PathData pathRB; - pathRB.AppendPoint(fRight - fHalfWidth, fTop - fHalfWidth, + pathRB.AppendPoint(CFX_PointF(fRight - fHalfWidth, fTop - fHalfWidth), FXPT_TYPE::MoveTo, false); - pathRB.AppendPoint(fRight - fHalfWidth, fBottom + fHalfWidth, - FXPT_TYPE::LineTo, false); - pathRB.AppendPoint(fLeft + fHalfWidth, fBottom + fHalfWidth, - FXPT_TYPE::LineTo, false); - pathRB.AppendPoint(fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, + pathRB.AppendPoint( + CFX_PointF(fRight - fHalfWidth, fBottom + fHalfWidth), + FXPT_TYPE::LineTo, false); + pathRB.AppendPoint(CFX_PointF(fLeft + fHalfWidth, fBottom + fHalfWidth), FXPT_TYPE::LineTo, false); - pathRB.AppendPoint(fRight - fHalfWidth * 2, fBottom + fHalfWidth * 2, - FXPT_TYPE::LineTo, false); - pathRB.AppendPoint(fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, - FXPT_TYPE::LineTo, false); - pathRB.AppendPoint(fRight - fHalfWidth, fTop - fHalfWidth, + pathRB.AppendPoint( + CFX_PointF(fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2), + FXPT_TYPE::LineTo, false); + pathRB.AppendPoint( + CFX_PointF(fRight - fHalfWidth * 2, fBottom + fHalfWidth * 2), + FXPT_TYPE::LineTo, false); + pathRB.AppendPoint( + CFX_PointF(fRight - fHalfWidth * 2, fTop - fHalfWidth * 2), + FXPT_TYPE::LineTo, false); + pathRB.AppendPoint(CFX_PointF(fRight - fHalfWidth, fTop - fHalfWidth), FXPT_TYPE::LineTo, false); pDevice->DrawPath(&pathRB, pUser2Device, &gsd, @@ -1427,9 +1436,10 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, } case BorderStyle::UNDERLINE: { CFX_PathData path; - path.AppendPoint(fLeft, fBottom + fWidth / 2, FXPT_TYPE::MoveTo, false); - path.AppendPoint(fRight, fBottom + fWidth / 2, FXPT_TYPE::LineTo, - false); + path.AppendPoint(CFX_PointF(fLeft, fBottom + fWidth / 2), + FXPT_TYPE::MoveTo, false); + path.AppendPoint(CFX_PointF(fRight, fBottom + fWidth / 2), + FXPT_TYPE::LineTo, false); CFX_GraphStateData gsd; gsd.m_LineWidth = fWidth; |