summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_list_box.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_list_box.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_list_box.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_list_box.cpp b/fpdfsdk/pdfwindow/cpwl_list_box.cpp
index 61f9aafa8f..79559d33f0 100644
--- a/fpdfsdk/pdfwindow/cpwl_list_box.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_list_box.cpp
@@ -405,8 +405,13 @@ float CPWL_ListBox::GetFirstHeight() const {
}
CFX_FloatRect CPWL_ListBox::GetListRect() const {
- return CPWL_Utils::DeflateRect(
- GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth()));
+ CFX_FloatRect rect = GetWindowRect();
+ if (!rect.IsEmpty()) {
+ float width = static_cast<float>(GetBorderWidth() + GetInnerBorderWidth());
+ rect.Deflate(width, width);
+ rect.Normalize();
+ }
+ return rect;
}
bool CPWL_ListBox::OnMouseWheel(short zDelta,