diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-26 14:24:28 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-26 14:24:28 -0800 |
commit | 281a9eadff15b167e2ee3032e21b83190ad49125 (patch) | |
tree | f02f7d0842f59d8e69bda011b3e62547ffb1acde /fpdfsdk/src/pdfwindow/PWL_Caret.cpp | |
parent | 566b974287ce0e81a963138152b8898f22480f52 (diff) | |
download | pdfium-281a9eadff15b167e2ee3032e21b83190ad49125.tar.xz |
Re-land "Replace CPDF_Rect and CPDF_Point with CFX types."
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1737593006 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Caret.cpp')
-rw-r--r-- | fpdfsdk/src/pdfwindow/PWL_Caret.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp index 75c951068a..320b2bf62f 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp @@ -24,14 +24,14 @@ CFX_ByteString CPWL_Caret::GetClassName() const { } void CPWL_Caret::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { - GetCaretApp(sAppStream, CPDF_Point(0.0f, 0.0f)); + GetCaretApp(sAppStream, CFX_FloatPoint(0.0f, 0.0f)); } void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { if (IsVisible() && m_bFlash) { - CPDF_Rect rcRect = GetCaretRect(); - CPDF_Rect rcClip = GetClipRect(); + CFX_FloatRect rcRect = GetCaretRect(); + CFX_FloatRect rcClip = GetClipRect(); CFX_PathData path; @@ -65,12 +65,12 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, } void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf& sAppStream, - const CPDF_Point& ptOffset) { + const CFX_FloatPoint& ptOffset) { if (IsVisible() && m_bFlash) { CFX_ByteTextBuf sCaret; - CPDF_Rect rcRect = GetCaretRect(); - CPDF_Rect rcClip = GetClipRect(); + CFX_FloatRect rcRect = GetCaretRect(); + CFX_FloatRect rcClip = GetClipRect(); rcRect = CPWL_Utils::OffsetRect(rcRect, ptOffset.x, ptOffset.y); rcClip = CPWL_Utils::OffsetRect(rcClip, ptOffset.x, ptOffset.y); @@ -90,7 +90,7 @@ void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf& sAppStream, } CFX_ByteString CPWL_Caret::GetCaretAppearanceStream( - const CPDF_Point& ptOffset) { + const CFX_FloatPoint& ptOffset) { CFX_ByteTextBuf sCaret; GetCaretApp(sCaret, ptOffset); return sCaret.GetByteString(); @@ -105,13 +105,14 @@ void CPWL_Caret::TimerProc() { } } -CPDF_Rect CPWL_Caret::GetCaretRect() const { - return CPDF_Rect(m_ptFoot.x, m_ptFoot.y, m_ptHead.x + m_fWidth, m_ptHead.y); +CFX_FloatRect CPWL_Caret::GetCaretRect() const { + return CFX_FloatRect(m_ptFoot.x, m_ptFoot.y, m_ptHead.x + m_fWidth, + m_ptHead.y); } void CPWL_Caret::SetCaret(FX_BOOL bVisible, - const CPDF_Point& ptHead, - const CPDF_Point& ptFoot) { + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& ptFoot) { if (bVisible) { if (IsVisible()) { if (m_ptHead.x != ptHead.x || m_ptHead.y != ptHead.y || @@ -135,8 +136,8 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, Move(m_rcInvalid, FALSE, TRUE); } } else { - m_ptHead = CPDF_Point(0, 0); - m_ptFoot = CPDF_Point(0, 0); + m_ptHead = CFX_FloatPoint(0, 0); + m_ptFoot = CFX_FloatPoint(0, 0); m_bFlash = FALSE; if (IsVisible()) { @@ -146,9 +147,9 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, } } -void CPWL_Caret::InvalidateRect(CPDF_Rect* pRect) { +void CPWL_Caret::InvalidateRect(CFX_FloatRect* pRect) { if (pRect) { - CPDF_Rect rcRefresh = CPWL_Utils::InflateRect(*pRect, 0.5f); + CFX_FloatRect rcRefresh = CPWL_Utils::InflateRect(*pRect, 0.5f); rcRefresh.top += 1; rcRefresh.bottom -= 1; |