From d6aff2f2e8469344becd6f73e443c31bca9baac0 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 13 Jul 2017 21:36:29 -0400 Subject: 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 Reviewed-by: Tom Sepez --- fpdfsdk/pdfwindow/cpwl_special_button.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'fpdfsdk/pdfwindow/cpwl_special_button.cpp') diff --git a/fpdfsdk/pdfwindow/cpwl_special_button.cpp b/fpdfsdk/pdfwindow/cpwl_special_button.cpp index 743565f0dc..da91da3ecb 100644 --- a/fpdfsdk/pdfwindow/cpwl_special_button.cpp +++ b/fpdfsdk/pdfwindow/cpwl_special_button.cpp @@ -18,13 +18,8 @@ CFX_ByteString CPWL_PushButton::GetClassName() const { } CFX_FloatRect CPWL_PushButton::GetFocusRect() const { - CFX_FloatRect rect = GetWindowRect(); - if (!rect.IsEmpty()) { - rect.Deflate(static_cast(GetBorderWidth()), - static_cast(GetBorderWidth())); - rect.Normalize(); - } - return rect; + return GetWindowRect().GetDeflated(static_cast(GetBorderWidth()), + static_cast(GetBorderWidth())); } CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false) {} -- cgit v1.2.3