From ebcd792ff7ebb9c15b2357090ae710a322f0d86d Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 16 Dec 2015 22:24:47 -0600 Subject: [PATCH] fix(scrollTo): change parseInt to Math.round --- ionic/animations/scroll-to.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ionic/animations/scroll-to.ts b/ionic/animations/scroll-to.ts index 386841be86..b2f706fea8 100644 --- a/ionic/animations/scroll-to.ts +++ b/ionic/animations/scroll-to.ts @@ -64,7 +64,7 @@ export class ScrollTo { if (!self._el) { return resolve(); } - + let time = Math.min(1, ((Date.now() - start) / duration)); // where .5 would be 50% of time on a linear scale easedT gives a @@ -72,10 +72,10 @@ export class ScrollTo { let easedT = easeOutCubic(time); if (fromY != y) { - self._el.scrollTop = parseInt((easedT * (y - fromY)) + fromY, 10); + self._el.scrollTop = Math.round((easedT * (y - fromY)) + fromY); } if (fromX != x) { - self._el.scrollLeft = parseInt((easedT * (x - fromX)) + fromX, 10); + self._el.scrollLeft = Math.round((easedT * (x - fromX)) + fromX); } if (time < 1 && self.isPlaying) {