summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/cfwl_edit.cpp7
-rw-r--r--xfa/fwl/theme/cfwl_checkboxtp.cpp100
-rw-r--r--xfa/fwl/theme/cfwl_monthcalendartp.cpp44
-rw-r--r--xfa/fwl/theme/cfwl_pushbuttontp.cpp31
-rw-r--r--xfa/fwl/theme/cfwl_scrollbartp.cpp72
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.cpp48
6 files changed, 169 insertions, 133 deletions
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index 35a83f9da5..d343090647 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -49,10 +49,10 @@ void AddSquigglyPath(CFX_Path* pPathData,
FX_FLOAT fEndX,
FX_FLOAT fY,
FX_FLOAT fStep) {
- pPathData->MoveTo(fStartX, fY);
+ pPathData->MoveTo(CFX_PointF(fStartX, fY));
int i = 1;
for (FX_FLOAT fx = fStartX + fStep; fx < fEndX; fx += fStep, ++i)
- pPathData->LineTo(fx, fY + (i & 1) * fStep);
+ pPathData->LineTo(CFX_PointF(fx, fY + (i & 1) * fStep));
}
} // namespace
@@ -587,7 +587,8 @@ void CFWL_Edit::DrawContent(CFX_Graphics* pGraphics,
FX_FLOAT fLeft = m_rtEngine.left + 1;
for (int32_t i = 1; i < iLimit; i++) {
fLeft += fStep;
- path.AddLine(fLeft, m_rtClient.top, fLeft, m_rtClient.bottom());
+ path.AddLine(CFX_PointF(fLeft, m_rtClient.top),
+ CFX_PointF(fLeft, m_rtClient.bottom()));
}
CFWL_ThemeBackground param;
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 052b9c1638..7876b71db5 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -94,10 +94,13 @@ void CFWL_CheckBoxTP::DrawSignCross(CFX_Graphics* pGraphics,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
+
FX_FLOAT fRight = pRtSign->right();
FX_FLOAT fBottom = pRtSign->bottom();
- path.AddLine(pRtSign->left, pRtSign->top, fRight, fBottom);
- path.AddLine(pRtSign->left, fBottom, fRight, pRtSign->top);
+ path.AddLine(pRtSign->TopLeft(), CFX_PointF(fRight, fBottom));
+ path.AddLine(CFX_PointF(pRtSign->left, fBottom),
+ CFX_PointF(fRight, pRtSign->top));
+
CFX_Color crFill(argbFill);
pGraphics->SaveGraphState();
pGraphics->SetStrokeColor(&crFill);
@@ -112,14 +115,16 @@ void CFWL_CheckBoxTP::DrawSignDiamond(CFX_Graphics* pGraphics,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
+
FX_FLOAT fWidth = pRtSign->width;
FX_FLOAT fHeight = pRtSign->height;
FX_FLOAT fBottom = pRtSign->bottom();
- path.MoveTo(pRtSign->left + fWidth / 2, pRtSign->top);
- path.LineTo(pRtSign->left, pRtSign->top + fHeight / 2);
- path.LineTo(pRtSign->left + fWidth / 2, fBottom);
- path.LineTo(pRtSign->right(), pRtSign->top + fHeight / 2);
- path.LineTo(pRtSign->left + fWidth / 2, pRtSign->top);
+ path.MoveTo(CFX_PointF(pRtSign->left + fWidth / 2, pRtSign->top));
+ path.LineTo(CFX_PointF(pRtSign->left, pRtSign->top + fHeight / 2));
+ path.LineTo(CFX_PointF(pRtSign->left + fWidth / 2, fBottom));
+ path.LineTo(CFX_PointF(pRtSign->right(), pRtSign->top + fHeight / 2));
+ path.LineTo(CFX_PointF(pRtSign->left + fWidth / 2, pRtSign->top));
+
CFX_Color crFill(argbFill);
pGraphics->SaveGraphState();
pGraphics->SetFillColor(&crFill);
@@ -148,27 +153,32 @@ void CFWL_CheckBoxTP::DrawSignStar(CFX_Graphics* pGraphics,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
+
FX_FLOAT fBottom = pRtSign->bottom();
FX_FLOAT fRadius =
- (pRtSign->top - fBottom) / (1 + (FX_FLOAT)cos(FX_PI / 5.0f));
+ (pRtSign->top - fBottom) / (1 + static_cast<FX_FLOAT>(cos(FX_PI / 5.0f)));
CFX_PointF ptCenter((pRtSign->left + pRtSign->right()) / 2.0f,
(pRtSign->top + fBottom) / 2.0f);
- FX_FLOAT px[5], py[5];
+
+ CFX_PointF points[5];
FX_FLOAT fAngel = FX_PI / 10.0f;
for (int32_t i = 0; i < 5; i++) {
- px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel);
- py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel);
+ points[i] =
+ ptCenter + CFX_PointF(fRadius * static_cast<FX_FLOAT>(cos(fAngel)),
+ fRadius * static_cast<FX_FLOAT>(sin(fAngel)));
fAngel += FX_PI * 2 / 5.0f;
}
- path.MoveTo(px[0], py[0]);
+
+ path.MoveTo(points[0]);
int32_t nNext = 0;
for (int32_t j = 0; j < 5; j++) {
nNext += 2;
- if (nNext >= 5) {
+ if (nNext >= 5)
nNext -= 5;
- }
- path.LineTo(px[nNext], py[nNext]);
+
+ path.LineTo(points[nNext]);
}
+
CFX_Color crFill(argbFill);
pGraphics->SaveGraphState();
pGraphics->SetFillColor(&crFill);
@@ -218,6 +228,7 @@ void CFWL_CheckBoxTP::InitCheckPath(FX_FLOAT fCheckLen) {
if (!m_pCheckPath) {
m_pCheckPath = pdfium::MakeUnique<CFX_Path>();
m_pCheckPath->Create();
+
FX_FLOAT fWidth = kSignPath;
FX_FLOAT fHeight = -kSignPath;
FX_FLOAT fBottom = kSignPath;
@@ -238,45 +249,32 @@ void CFWL_CheckBoxTP::InitCheckPath(FX_FLOAT fCheckLen) {
CFX_PointF pt54(fWidth / 3.4f, fBottom + fHeight / 3.5f);
CFX_PointF pt51(fWidth / 3.6f, fBottom + fHeight / 4.0f);
CFX_PointF pt15(fWidth / 3.5f, fBottom + fHeight * 3.5f / 5.0f);
- m_pCheckPath->MoveTo(pt1.x, pt1.y);
- FX_FLOAT px1 = pt12.x - pt1.x;
- FX_FLOAT py1 = pt12.y - pt1.y;
- FX_FLOAT px2 = pt21.x - pt2.x;
- FX_FLOAT py2 = pt21.y - pt2.y;
- m_pCheckPath->BezierTo(pt1.x + px1 * FX_BEZIER, pt1.y + py1 * FX_BEZIER,
- pt2.x + px2 * FX_BEZIER, pt2.y + py2 * FX_BEZIER,
- pt2.x, pt2.y);
- px1 = pt23.x - pt2.x;
- py1 = pt23.y - pt2.y;
- px2 = pt32.x - pt3.x;
- py2 = pt32.y - pt3.y;
- m_pCheckPath->BezierTo(pt2.x + px1 * FX_BEZIER, pt2.y + py1 * FX_BEZIER,
- pt3.x + px2 * FX_BEZIER, pt3.y + py2 * FX_BEZIER,
- pt3.x, pt3.y);
- px1 = pt34.x - pt3.x;
- py1 = pt34.y - pt3.y;
- px2 = pt43.x - pt4.x;
- py2 = pt43.y - pt4.y;
- m_pCheckPath->BezierTo(pt3.x + px1 * FX_BEZIER, pt3.y + py1 * FX_BEZIER,
- pt4.x + px2 * FX_BEZIER, pt4.y + py2 * FX_BEZIER,
- pt4.x, pt4.y);
- px1 = pt45.x - pt4.x;
- py1 = pt45.y - pt4.y;
- px2 = pt54.x - pt5.x;
- py2 = pt54.y - pt5.y;
- m_pCheckPath->BezierTo(pt4.x + px1 * FX_BEZIER, pt4.y + py1 * FX_BEZIER,
- pt5.x + px2 * FX_BEZIER, pt5.y + py2 * FX_BEZIER,
- pt5.x, pt5.y);
- px1 = pt51.x - pt5.x;
- py1 = pt51.y - pt5.y;
- px2 = pt15.x - pt1.x;
- py2 = pt15.y - pt1.y;
- m_pCheckPath->BezierTo(pt5.x + px1 * FX_BEZIER, pt5.y + py1 * FX_BEZIER,
- pt1.x + px2 * FX_BEZIER, pt1.y + py2 * FX_BEZIER,
- pt1.x, pt1.y);
+ m_pCheckPath->MoveTo(pt1);
+
+ CFX_PointF p1 = CFX_PointF(pt12.x - pt1.x, pt12.y - pt1.y) * FX_BEZIER;
+ CFX_PointF p2 = CFX_PointF(pt21.x - pt2.x, pt21.y - pt2.y) * FX_BEZIER;
+ m_pCheckPath->BezierTo(pt1 + p1, pt2 + p2, pt2);
+
+ p1 = CFX_PointF(pt23.x - pt2.x, pt23.y - pt2.y) * FX_BEZIER;
+ p2 = CFX_PointF(pt32.x - pt3.x, pt32.y - pt3.y) * FX_BEZIER;
+ m_pCheckPath->BezierTo(pt2 + p1, pt3 + p2, pt3);
+
+ p1 = CFX_PointF(pt34.x - pt3.x, pt34.y - pt3.y) * FX_BEZIER;
+ p2 = CFX_PointF(pt43.x - pt4.x, pt43.y - pt4.y) * FX_BEZIER;
+ m_pCheckPath->BezierTo(pt3 + p1, pt4 + p2, pt4);
+
+ p1 = CFX_PointF(pt45.x - pt4.x, pt45.y - pt4.y) * FX_BEZIER;
+ p2 = CFX_PointF(pt54.x - pt5.x, pt54.y - pt5.y) * FX_BEZIER;
+ m_pCheckPath->BezierTo(pt4 + p1, pt5 + p2, pt5);
+
+ p1 = CFX_PointF(pt51.x - pt5.x, pt51.y - pt5.y) * FX_BEZIER;
+ p2 = CFX_PointF(pt15.x - pt1.x, pt15.y - pt1.y) * FX_BEZIER;
+ m_pCheckPath->BezierTo(pt5 + p1, pt1 + p2, pt1);
+
FX_FLOAT fScale = fCheckLen / kSignPath;
CFX_Matrix mt(1, 0, 0, 1, 0, 0);
mt.Scale(fScale, fScale);
+
CFX_PathData* pData = m_pCheckPath->GetPathData();
pData->Transform(&mt);
}
diff --git a/xfa/fwl/theme/cfwl_monthcalendartp.cpp b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
index 476135fa44..cf6306a53f 100644
--- a/xfa/fwl/theme/cfwl_monthcalendartp.cpp
+++ b/xfa/fwl/theme/cfwl_monthcalendartp.cpp
@@ -106,9 +106,11 @@ void CFWL_MonthCalendarTP::DrawTotalBK(CFWL_ThemeBackground* pParams,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
+
CFX_RectF rtTotal(pParams->m_rtPart);
path.AddRectangle(rtTotal.left, rtTotal.top, rtTotal.width, rtTotal.height);
pParams->m_pGraphics->SaveGraphState();
+
CFX_Color clrBK(m_pThemeData->clrBK);
pParams->m_pGraphics->SetFillColor(&clrBK);
pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
@@ -119,9 +121,11 @@ void CFWL_MonthCalendarTP::DrawHeadBk(CFWL_ThemeBackground* pParams,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
+
CFX_RectF rtHead = pParams->m_rtPart;
path.AddRectangle(rtHead.left, rtHead.top, rtHead.width, rtHead.height);
pParams->m_pGraphics->SaveGraphState();
+
CFX_Color clrHeadBK(m_pThemeData->clrBK);
pParams->m_pGraphics->SetFillColor(&clrHeadBK);
pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
@@ -132,9 +136,11 @@ void CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
+
CFX_RectF rtLBtn = pParams->m_rtPart;
path.AddRectangle(rtLBtn.left, rtLBtn.top, rtLBtn.width, rtLBtn.height);
pParams->m_pGraphics->SaveGraphState();
+
CFX_Color clrLBtnEdge(ArgbEncode(0xff, 205, 219, 243));
pParams->m_pGraphics->SetStrokeColor(&clrLBtnEdge);
pParams->m_pGraphics->StrokePath(&path, pMatrix);
@@ -147,12 +153,15 @@ void CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams,
pParams->m_pGraphics->SetFillColor(&clrLBtnFill);
pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
}
+
path.Clear();
- path.MoveTo(rtLBtn.left + rtLBtn.Width() / 3 * 2,
- rtLBtn.top + rtLBtn.height / 4);
- path.LineTo(rtLBtn.left + rtLBtn.Width() / 3, rtLBtn.top + rtLBtn.height / 2);
- path.LineTo(rtLBtn.left + rtLBtn.Width() / 3 * 2,
- rtLBtn.bottom() - rtLBtn.height / 4);
+ path.MoveTo(CFX_PointF(rtLBtn.left + rtLBtn.Width() / 3 * 2,
+ rtLBtn.top + rtLBtn.height / 4));
+ path.LineTo(CFX_PointF(rtLBtn.left + rtLBtn.Width() / 3,
+ rtLBtn.top + rtLBtn.height / 2));
+ path.LineTo(CFX_PointF(rtLBtn.left + rtLBtn.Width() / 3 * 2,
+ rtLBtn.bottom() - rtLBtn.height / 4));
+
CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205));
pParams->m_pGraphics->SetStrokeColor(&clrFlag);
pParams->m_pGraphics->StrokePath(&path, pMatrix);
@@ -163,9 +172,11 @@ void CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
+
CFX_RectF rtRBtn = pParams->m_rtPart;
path.AddRectangle(rtRBtn.left, rtRBtn.top, rtRBtn.width, rtRBtn.height);
pParams->m_pGraphics->SaveGraphState();
+
CFX_Color clrRBtnEdge(ArgbEncode(0xff, 205, 219, 243));
pParams->m_pGraphics->SetStrokeColor(&clrRBtnEdge);
pParams->m_pGraphics->StrokePath(&path, pMatrix);
@@ -178,12 +189,15 @@ void CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams,
pParams->m_pGraphics->SetFillColor(&clrRBtnFill);
pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
}
+
path.Clear();
- path.MoveTo(rtRBtn.left + rtRBtn.Width() / 3, rtRBtn.top + rtRBtn.height / 4);
- path.LineTo(rtRBtn.left + rtRBtn.Width() / 3 * 2,
- rtRBtn.top + rtRBtn.height / 2);
- path.LineTo(rtRBtn.left + rtRBtn.Width() / 3,
- rtRBtn.bottom() - rtRBtn.height / 4);
+ path.MoveTo(CFX_PointF(rtRBtn.left + rtRBtn.Width() / 3,
+ rtRBtn.top + rtRBtn.height / 4));
+ path.LineTo(CFX_PointF(rtRBtn.left + rtRBtn.Width() / 3 * 2,
+ rtRBtn.top + rtRBtn.height / 2));
+ path.LineTo(CFX_PointF(rtRBtn.left + rtRBtn.Width() / 3,
+ rtRBtn.bottom() - rtRBtn.height / 4));
+
CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205));
pParams->m_pGraphics->SetStrokeColor(&clrFlag);
pParams->m_pGraphics->StrokePath(&path, pMatrix);
@@ -195,9 +209,10 @@ void CFWL_MonthCalendarTP::DrawHSeperator(CFWL_ThemeBackground* pParams,
CFX_Path path;
path.Create();
CFX_RectF rtHSep = pParams->m_rtPart;
- path.MoveTo(rtHSep.left, rtHSep.top + rtHSep.height / 2);
- path.LineTo(rtHSep.right(), rtHSep.top + rtHSep.height / 2);
+ path.MoveTo(CFX_PointF(rtHSep.left, rtHSep.top + rtHSep.height / 2));
+ path.LineTo(CFX_PointF(rtHSep.right(), rtHSep.top + rtHSep.height / 2));
pParams->m_pGraphics->SaveGraphState();
+
CFX_Color clrHSep(m_pThemeData->clrSeperator);
pParams->m_pGraphics->SetStrokeColor(&clrHSep);
pParams->m_pGraphics->StrokePath(&path, pMatrix);
@@ -209,9 +224,10 @@ void CFWL_MonthCalendarTP::DrawWeekNumSep(CFWL_ThemeBackground* pParams,
CFX_Path path;
path.Create();
CFX_RectF rtWeekSep = pParams->m_rtPart;
- path.MoveTo(rtWeekSep.left, rtWeekSep.top);
- path.LineTo(rtWeekSep.left, rtWeekSep.bottom());
+ path.MoveTo(rtWeekSep.TopLeft());
+ path.LineTo(rtWeekSep.BottomLeft());
pParams->m_pGraphics->SaveGraphState();
+
CFX_Color clrHSep(m_pThemeData->clrSeperator);
pParams->m_pGraphics->SetStrokeColor(&clrHSep);
pParams->m_pGraphics->StrokePath(&path, pMatrix);
diff --git a/xfa/fwl/theme/cfwl_pushbuttontp.cpp b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
index a1e57836fa..ba7b2ca506 100644
--- a/xfa/fwl/theme/cfwl_pushbuttontp.cpp
+++ b/xfa/fwl/theme/cfwl_pushbuttontp.cpp
@@ -31,39 +31,52 @@ void CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) {
CFX_RectF& rect = pParams->m_rtPart;
FX_FLOAT fRight = rect.right();
FX_FLOAT fBottom = rect.bottom();
+
CFX_Path strokePath;
strokePath.Create();
- strokePath.MoveTo(rect.left + PUSHBUTTON_SIZE_Corner, rect.top);
- strokePath.LineTo(fRight - PUSHBUTTON_SIZE_Corner, rect.top);
- strokePath.LineTo(fRight, rect.top + PUSHBUTTON_SIZE_Corner);
- strokePath.LineTo(fRight, fBottom - PUSHBUTTON_SIZE_Corner);
- strokePath.LineTo(fRight - PUSHBUTTON_SIZE_Corner, fBottom);
- strokePath.LineTo(rect.left + PUSHBUTTON_SIZE_Corner, fBottom);
- strokePath.LineTo(rect.left, fBottom - PUSHBUTTON_SIZE_Corner);
- strokePath.LineTo(rect.left, rect.top + PUSHBUTTON_SIZE_Corner);
- strokePath.LineTo(rect.left + PUSHBUTTON_SIZE_Corner, rect.top);
+ strokePath.MoveTo(
+ CFX_PointF(rect.left + PUSHBUTTON_SIZE_Corner, rect.top));
+ strokePath.LineTo(CFX_PointF(fRight - PUSHBUTTON_SIZE_Corner, rect.top));
+ strokePath.LineTo(CFX_PointF(fRight, rect.top + PUSHBUTTON_SIZE_Corner));
+ strokePath.LineTo(CFX_PointF(fRight, fBottom - PUSHBUTTON_SIZE_Corner));
+ strokePath.LineTo(CFX_PointF(fRight - PUSHBUTTON_SIZE_Corner, fBottom));
+ strokePath.LineTo(
+ CFX_PointF(rect.left + PUSHBUTTON_SIZE_Corner, fBottom));
+ strokePath.LineTo(
+ CFX_PointF(rect.left, fBottom - PUSHBUTTON_SIZE_Corner));
+ strokePath.LineTo(
+ CFX_PointF(rect.left, rect.top + PUSHBUTTON_SIZE_Corner));
+ strokePath.LineTo(
+ CFX_PointF(rect.left + PUSHBUTTON_SIZE_Corner, rect.top));
+
CFX_Path fillPath;
fillPath.Create();
fillPath.AddSubpath(&strokePath);
+
CFX_Graphics* pGraphics = pParams->m_pGraphics;
pGraphics->SaveGraphState();
+
CFX_RectF rtInner(rect);
rtInner.Deflate(PUSHBUTTON_SIZE_Corner + 1, PUSHBUTTON_SIZE_Corner + 1,
PUSHBUTTON_SIZE_Corner, PUSHBUTTON_SIZE_Corner);
fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width,
rtInner.height);
+
int32_t iColor = GetColorID(pParams->m_dwStates);
DrawAxialShading(pGraphics, rect.left + PUSHBUTTON_SIZE_Corner, rect.top,
rect.left + PUSHBUTTON_SIZE_Corner, rect.bottom(),
m_pThemeData->clrStart[iColor],
m_pThemeData->clrEnd[iColor], &fillPath,
FXFILL_ALTERNATE, &pParams->m_matrix);
+
CFX_Color crStroke(m_pThemeData->clrBorder[iColor]);
pGraphics->SetStrokeColor(&crStroke);
pGraphics->StrokePath(&strokePath, &pParams->m_matrix);
+
fillPath.Clear();
fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width,
rtInner.height);
+
CFX_Color crFill(m_pThemeData->clrFill[iColor]);
pGraphics->SetFillColor(&crFill);
pGraphics->FillPath(&fillPath, FXFILL_WINDING, &pParams->m_matrix);
diff --git a/xfa/fwl/theme/cfwl_scrollbartp.cpp b/xfa/fwl/theme/cfwl_scrollbartp.cpp
index 4cd2fb376d..5f8f7dcd49 100644
--- a/xfa/fwl/theme/cfwl_scrollbartp.cpp
+++ b/xfa/fwl/theme/cfwl_scrollbartp.cpp
@@ -130,30 +130,34 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
if (pRect->width / 2 <= fPawLen) {
fPawLen = (pRect->width - 6) / 2;
}
+
FX_FLOAT fX = pRect->left + pRect->width / 4;
FX_FLOAT fY = pRect->top + pRect->height / 2;
- path.MoveTo(fX, fY - 4);
- path.LineTo(fX + fPawLen, fY - 4);
- path.MoveTo(fX, fY - 2);
- path.LineTo(fX + fPawLen, fY - 2);
- path.MoveTo(fX, fY);
- path.LineTo(fX + fPawLen, fY);
- path.MoveTo(fX, fY + 2);
- path.LineTo(fX + fPawLen, fY + 2);
+ path.MoveTo(CFX_PointF(fX, fY - 4));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 4));
+ path.MoveTo(CFX_PointF(fX, fY - 2));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 2));
+ path.MoveTo(CFX_PointF(fX, fY));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY));
+ path.MoveTo(CFX_PointF(fX, fY + 2));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY + 2));
+
CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrLight);
pGraphics->StrokePath(&path);
fX++;
+
path.Clear();
- path.MoveTo(fX, fY - 3);
- path.LineTo(fX + fPawLen, fY - 3);
- path.MoveTo(fX, fY - 1);
- path.LineTo(fX + fPawLen, fY - 1);
- path.MoveTo(fX, fY + 1);
- path.LineTo(fX + fPawLen, fY + 1);
- path.MoveTo(fX, fY + 3);
- path.LineTo(fX + fPawLen, fY + 3);
+ path.MoveTo(CFX_PointF(fX, fY - 3));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 3));
+ path.MoveTo(CFX_PointF(fX, fY - 1));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY - 1));
+ path.MoveTo(CFX_PointF(fX, fY + 1));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY + 1));
+ path.MoveTo(CFX_PointF(fX, fY + 3));
+ path.LineTo(CFX_PointF(fX + fPawLen, fY + 3));
+
CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrDark);
@@ -163,30 +167,34 @@ void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
if (pRect->height / 2 <= fPawLen) {
fPawLen = (pRect->height - 6) / 2;
}
+
FX_FLOAT fX = pRect->left + pRect->width / 2;
FX_FLOAT fY = pRect->top + pRect->height / 4;
- path.MoveTo(fX - 4, fY);
- path.LineTo(fX - 4, fY + fPawLen);
- path.MoveTo(fX - 2, fY);
- path.LineTo(fX - 2, fY + fPawLen);
- path.MoveTo(fX, fY);
- path.LineTo(fX, fY + fPawLen);
- path.MoveTo(fX + 2, fY);
- path.LineTo(fX + 2, fY + fPawLen);
+ path.MoveTo(CFX_PointF(fX - 4, fY));
+ path.LineTo(CFX_PointF(fX - 4, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX - 2, fY));
+ path.LineTo(CFX_PointF(fX - 2, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX, fY));
+ path.LineTo(CFX_PointF(fX, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX + 2, fY));
+ path.LineTo(CFX_PointF(fX + 2, fY + fPawLen));
+
CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrLight);
pGraphics->StrokePath(&path, pMatrix);
fY++;
+
path.Clear();
- path.MoveTo(fX - 3, fY);
- path.LineTo(fX - 3, fY + fPawLen);
- path.MoveTo(fX - 1, fY);
- path.LineTo(fX - 1, fY + fPawLen);
- path.MoveTo(fX + 1, fY);
- path.LineTo(fX + 1, fY + fPawLen);
- path.MoveTo(fX + 3, fY);
- path.LineTo(fX + 3, fY + fPawLen);
+ path.MoveTo(CFX_PointF(fX - 3, fY));
+ path.LineTo(CFX_PointF(fX - 3, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX - 1, fY));
+ path.LineTo(CFX_PointF(fX - 1, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX + 1, fY));
+ path.LineTo(CFX_PointF(fX + 1, fY + fPawLen));
+ path.MoveTo(CFX_PointF(fX + 3, fY));
+ path.LineTo(CFX_PointF(fX + 3, fY + fPawLen));
+
CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrDark);
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index ad5beef858..d7d98cd76f 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -196,39 +196,39 @@ void CFWL_WidgetTP::DrawArrow(CFX_Graphics* pGraphics,
path.Create();
switch (eDict) {
case FWLTHEME_DIRECTION_Down: {
- path.MoveTo(fLeft, fTop + 1);
- path.LineTo(fLeft + 4, fTop + 5);
- path.LineTo(fLeft + 8, fTop + 1);
- path.LineTo(fLeft + 7, fTop);
- path.LineTo(fLeft + 4, fTop + 3);
- path.LineTo(fLeft + 1, fTop);
+ path.MoveTo(CFX_PointF(fLeft, fTop + 1));
+ path.LineTo(CFX_PointF(fLeft + 4, fTop + 5));
+ path.LineTo(CFX_PointF(fLeft + 8, fTop + 1));
+ path.LineTo(CFX_PointF(fLeft + 7, fTop));
+ path.LineTo(CFX_PointF(fLeft + 4, fTop + 3));
+ path.LineTo(CFX_PointF(fLeft + 1, fTop));
break;
}
case FWLTHEME_DIRECTION_Up: {
- path.MoveTo(fLeft, fTop + 4);
- path.LineTo(fLeft + 4, fTop);
- path.LineTo(fLeft + 8, fTop + 4);
- path.LineTo(fLeft + 7, fTop + 5);
- path.LineTo(fLeft + 4, fTop + 2);
- path.LineTo(fLeft + 1, fTop + 5);
+ path.MoveTo(CFX_PointF(fLeft, fTop + 4));
+ path.LineTo(CFX_PointF(fLeft + 4, fTop));
+ path.LineTo(CFX_PointF(fLeft + 8, fTop + 4));
+ path.LineTo(CFX_PointF(fLeft + 7, fTop + 5));
+ path.LineTo(CFX_PointF(fLeft + 4, fTop + 2));
+ path.LineTo(CFX_PointF(fLeft + 1, fTop + 5));
break;
}
case FWLTHEME_DIRECTION_Right: {
- path.MoveTo(fLeft + 1, fTop);
- path.LineTo(fLeft + 5, fTop + 4);
- path.LineTo(fLeft + 1, fTop + 8);
- path.LineTo(fLeft, fTop + 7);
- path.LineTo(fLeft + 3, fTop + 4);
- path.LineTo(fLeft, fTop + 1);
+ path.MoveTo(CFX_PointF(fLeft + 1, fTop));
+ path.LineTo(CFX_PointF(fLeft + 5, fTop + 4));
+ path.LineTo(CFX_PointF(fLeft + 1, fTop + 8));
+ path.LineTo(CFX_PointF(fLeft, fTop + 7));
+ path.LineTo(CFX_PointF(fLeft + 3, fTop + 4));
+ path.LineTo(CFX_PointF(fLeft, fTop + 1));
break;
}
case FWLTHEME_DIRECTION_Left: {
- path.MoveTo(fLeft, fTop + 4);
- path.LineTo(fLeft + 4, fTop);
- path.LineTo(fLeft + 5, fTop + 1);
- path.LineTo(fLeft + 2, fTop + 4);
- path.LineTo(fLeft + 5, fTop + 7);
- path.LineTo(fLeft + 4, fTop + 8);
+ path.MoveTo(CFX_PointF(fLeft, fTop + 4));
+ path.LineTo(CFX_PointF(fLeft + 4, fTop));
+ path.LineTo(CFX_PointF(fLeft + 5, fTop + 1));
+ path.LineTo(CFX_PointF(fLeft + 2, fTop + 4));
+ path.LineTo(CFX_PointF(fLeft + 5, fTop + 7));
+ path.LineTo(CFX_PointF(fLeft + 4, fTop + 8));
break;
}
}