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

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: actually upload 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') | no next file with comments »
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..282ca89009dda9f05b08b378b7e180781b333ac9 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.
+ if (std::min({content_insets.top(), content_insets.left(),
+ content_insets.bottom(), content_insets.right()}) > radius) {
+ return false;
+ }
gfx::RectF rect((gfx::Rect(size)));
- 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698