diff options
author | dan sinclair <dsinclair@chromium.org> | 2017-07-13 21:36:29 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-17 15:43:06 +0000 |
commit | d6aff2f2e8469344becd6f73e443c31bca9baac0 (patch) | |
tree | 1e14517547352b92e66f5256652debb3341acec4 /fpdfsdk/pdfwindow/cpwl_list_box.cpp | |
parent | 18531230381465592e1a037e6dfc39d4a6fb5def (diff) | |
download | pdfium-d6aff2f2e8469344becd6f73e443c31bca9baac0.tar.xz |
Add CFX_FloatRect::GetDeflated
This CL adds a method to CFX_FloatRect to get a new deflated rectangle
from a given rectangle.
Change-Id: I781222257c82baf94d5f77deede52fbe4e97c701
Reviewed-on: https://pdfium-review.googlesource.com/7850
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_list_box.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/cpwl_list_box.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_list_box.cpp b/fpdfsdk/pdfwindow/cpwl_list_box.cpp index 4b4df33e39..96df02c642 100644 --- a/fpdfsdk/pdfwindow/cpwl_list_box.cpp +++ b/fpdfsdk/pdfwindow/cpwl_list_box.cpp @@ -405,13 +405,8 @@ float CPWL_ListBox::GetFirstHeight() const { } CFX_FloatRect CPWL_ListBox::GetListRect() const { - CFX_FloatRect rect = GetWindowRect(); - if (!rect.IsEmpty()) { - float width = static_cast<float>(GetBorderWidth() + GetInnerBorderWidth()); - rect.Deflate(width, width); - rect.Normalize(); - } - return rect; + float width = static_cast<float>(GetBorderWidth() + GetInnerBorderWidth()); + return GetWindowRect().GetDeflated(width, width); } bool CPWL_ListBox::OnMouseWheel(short zDelta, |