summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_caret.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_caret.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_caret.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_caret.cpp b/fpdfsdk/pdfwindow/cpwl_caret.cpp
index 0d63622852..f49c77120c 100644
--- a/fpdfsdk/pdfwindow/cpwl_caret.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_caret.cpp
@@ -135,7 +135,11 @@ void CPWL_Caret::SetCaret(bool bVisible,
void CPWL_Caret::InvalidateRect(CFX_FloatRect* pRect) {
if (pRect) {
- CFX_FloatRect rcRefresh = CPWL_Utils::InflateRect(*pRect, 0.5f);
+ CFX_FloatRect rcRefresh = *pRect;
+ if (!rcRefresh.IsEmpty()) {
+ rcRefresh.Inflate(0.5f, 0.5f);
+ rcRefresh.Normalize();
+ }
rcRefresh.top += 1;
rcRefresh.bottom -= 1;
CPWL_Wnd::InvalidateRect(&rcRefresh);