summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 13:09:42 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 13:09:42 -0800
commit3b8fdd34bdf57ec45291b77008a43249f838efcb (patch)
treeb65090a7c1fbedcda6499c3be4ffcaf8453e9e11 /fpdfsdk/src/pdfwindow/PWL_Caret.cpp
parent8ba5b59356d506d3b9e976e7422e69bbd5bec8d6 (diff)
downloadpdfium-3b8fdd34bdf57ec45291b77008a43249f838efcb.tar.xz
Replace CPDF_Rect and CPDF_Point with CFX types.
Too many rectangle types. Remove CPDF_Rect #define, and make an equivalent point type in CFX, but stop short of consolidating the N different forms of rectangles in CFX. Also banish PDF_ClipFloat to the one .cpp file that needs it, since it was in the vicinity of the .h file changes. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1740923003 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Caret.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Caret.cpp31
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;