summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_special_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_special_button.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_special_button.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_special_button.cpp b/fpdfsdk/pdfwindow/cpwl_special_button.cpp
index 56aa739545..743565f0dc 100644
--- a/fpdfsdk/pdfwindow/cpwl_special_button.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_special_button.cpp
@@ -18,7 +18,13 @@ CFX_ByteString CPWL_PushButton::GetClassName() const {
}
CFX_FloatRect CPWL_PushButton::GetFocusRect() const {
- return CPWL_Utils::DeflateRect(GetWindowRect(), (float)GetBorderWidth());
+ CFX_FloatRect rect = GetWindowRect();
+ if (!rect.IsEmpty()) {
+ rect.Deflate(static_cast<float>(GetBorderWidth()),
+ static_cast<float>(GetBorderWidth()));
+ rect.Normalize();
+ }
+ return rect;
}
CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false) {}