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

Unified Diff: ui/views/view.cc

Issue 2188133002: Scroll with Layers in views::ScrollView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollTrack
Patch Set: bugref, scale_delta DCHECK + comment Created 4 years, 4 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/controls/scroll_view_unittest.cc ('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 778edb89189d7cb271c7b9809718a760c0368599..e6d51dd2cc56b693ab36adcce0041bb033c29352 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -447,7 +447,13 @@ void View::OnEnabledChanged() {
// Transformations -------------------------------------------------------------
gfx::Transform View::GetTransform() const {
- return layer() ? layer()->transform() : gfx::Transform();
+ if (!layer())
+ return gfx::Transform();
+
+ gfx::Transform transform = layer()->transform();
+ gfx::ScrollOffset scroll_offset = layer()->CurrentScrollOffset();
+ transform.Translate(-scroll_offset.x(), -scroll_offset.y());
+ return transform;
}
void View::SetTransform(const gfx::Transform& transform) {
« no previous file with comments | « ui/views/controls/scroll_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698