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

Unified Diff: ui/views/view.cc

Issue 2897533003: Change default ink drop center points to center of contents bounds (Closed)
Patch Set: fix compile Created 3 years, 7 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 | « ui/views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 59f4d3bb3c0bda2155b01b391accb5d3d770c6de..28f10807fd78e102d677fcf46762e1170dcdebde 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -575,9 +575,14 @@ int View::GetMirroredX() const {
return parent_ ? parent_->GetMirroredXForRect(bounds_) : x();
}
-int View::GetMirroredXForRect(const gfx::Rect& bounds) const {
- return base::i18n::IsRTL() ?
- (width() - bounds.x() - bounds.width()) : bounds.x();
+int View::GetMirroredXForRect(const gfx::Rect& rect) const {
+ return base::i18n::IsRTL() ? (width() - rect.x() - rect.width()) : rect.x();
+}
+
+gfx::Rect View::GetMirroredRect(const gfx::Rect& rect) const {
+ gfx::Rect mirrored_rect = rect;
+ mirrored_rect.set_x(GetMirroredXForRect(rect));
+ return mirrored_rect;
}
int View::GetMirroredXInView(int x) const {
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698