Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 1836993004: Fix bubble client area clipping regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index 4c342a52a64a02d58b35d863afb5ee1806b720e1..34f9bc1613dcb0caf697fd7c140943a0de11496b 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -139,8 +139,13 @@ gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds(
bool BubbleFrameView::GetClientMask(const gfx::Size& size,
gfx::Path* path) const {
const int radius = bubble_border_->GetBorderCornerRadius();
+ gfx::Insets content_insets = GetInsets();
+ // If the client bounds don't touch the edges, no need to mask.
Evan Stade 2016/03/29 01:27:58 This additional early return is not necessary for
+ if (content_insets.top() > radius && content_insets.left() > radius &&
+ content_insets.bottom() > radius && content_insets.right()) {
msw 2016/03/29 22:54:55 Did you mean to check |content_insets.right() > ra
Evan Stade 2016/03/29 23:04:41 good idea, done.
+ return false;
+ }
gfx::RectF rect((gfx::Rect(size)));
msw 2016/03/29 22:54:55 nit: remove extra parens?
Evan Stade 2016/03/29 23:04:41 that produces an error message: ../../ui/views/bu
msw 2016/03/29 23:08:27 Weird, but this seems familiar, and likely came up
- rect.Inset(gfx::InsetsF(0.5f));
path->addRoundRect(gfx::RectFToSkRect(rect), radius, radius);
return true;
}
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698