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 /xfa/fwl/theme/cfwl_monthcalendartp.cpp | |
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 'xfa/fwl/theme/cfwl_monthcalendartp.cpp')
-rw-r--r-- | xfa/fwl/theme/cfwl_monthcalendartp.cpp | 44 |
1 files changed, 30 insertions, 14 deletions
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); |