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

Unified Diff: sky/framework/sky-scrollable.sky

Issue 969493002: Add support for scroll and fling gestures to SkyShell. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: updated Created 5 years, 10 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 | sky/services/viewport/input_event.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/sky-scrollable.sky
diff --git a/sky/framework/sky-scrollable.sky b/sky/framework/sky-scrollable.sky
index 7f5e60d21f729096c19d54d0381961bcc5258289..323639e55b0cd567a23792de03d52a4721685698 100644
--- a/sky/framework/sky-scrollable.sky
+++ b/sky/framework/sky-scrollable.sky
@@ -94,8 +94,10 @@ class SkyScrollable extends SkyElement {
double newScrollOffset = math.max(0.0, math.min(scrollRange, value));
if (newScrollOffset == _scrollOffset)
return;
+ // TODO(eseidel): We should scroll in device pixels instead of logical
+ // pixels, but to do that correctly we need to use a device pixel unit.
_scrollOffset = newScrollOffset;
- String transform = 'translateY(${(-_scrollOffset).toStringAsFixed(2)}px)';
+ String transform = 'translateY(${(-_scrollOffset).toInt()}px)';
_scrollable.style['transform'] = transform;
double topPercent = newScrollOffset / innerHeight * 100.0;
« no previous file with comments | « no previous file | sky/services/viewport/input_event.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698