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

Unified Diff: ui/views/controls/scroll_view.cc

Issue 2509783002: Don't reset scroll position of contents on every ScrollView layout. (Closed)
Patch Set: Created 4 years, 1 month 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 | « ash/common/system/tray/tray_details_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scroll_view.cc
diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
index 8a0c2590e8d2eae11644a63eddd61455fc6c0fa6..86a8cc3f75039ffb42c2db19e94c53ab97490459 100644
--- a/ui/views/controls/scroll_view.cc
+++ b/ui/views/controls/scroll_view.cc
@@ -313,8 +313,7 @@ void ScrollView::Layout() {
content_width = std::max(content_width - GetScrollBarWidth(), 0);
content_height = contents()->GetHeightForWidth(content_width);
}
- if (contents()->bounds().size() != gfx::Size(content_width, content_height))
- contents()->SetBounds(0, 0, content_width, content_height);
+ contents()->SetSize(gfx::Size(content_width, content_height));
sky 2016/11/16 20:12:57 It would be nice if we were consistent and used co
Evan Stade 2016/11/17 01:14:00 (also done)
}
// Most views will want to auto-fit the available space. Most of them want to
« no previous file with comments | « ash/common/system/tray/tray_details_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698