Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(850)

Unified Diff: fpdfsdk/src/pdfwindow/PWL_Caret.cpp

Issue 1737593006: Re-land "Replace CPDF_Rect and CPDF_Point with CFX types." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Ooops. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/pdfwindow/PWL_Button.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/pdfwindow/PWL_Caret.cpp
diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
index 75c951068a3e390b7e17fc9999cf2863b5fc1b62..320b2bf62f9462dfba7861c1a876cf32f4eb8f64 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;
« no previous file with comments | « fpdfsdk/src/pdfwindow/PWL_Button.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698