Skip to content
Browse files

Reverted some scroll code

  • Loading branch information...
1 parent f0cb914 commit 967fa2fa9f55f91aac89b22c5c2fdef587bb39de @louisstow louisstow committed Mar 28, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/extensions.js
View
5 src/extensions.js
@@ -350,7 +350,8 @@ Crafty.extend({
* shifting everything in the viewport 500 pixels to the left.
*/
scroll: function (axis, v) {
- var change = Math.floor(v - this[axis]), //change in direction
+ v = Math.floor(v);
+ var change = v - this[axis], //change in direction
context = Crafty.canvas.context,
style = Crafty.stage.inner.style,
canvas;
@@ -363,7 +364,7 @@ Crafty.extend({
if (context) context.translate(0, change);
}
if (context) Crafty.DrawManager.drawAll();
- style[axis == '_x' ? "left" : "top"] = Math.round(~~v) + "px";
+ style[axis == '_x' ? "left" : "top"] = v + "px";
},
rect: function () {

0 comments on commit 967fa2f

Please sign in to comment.
Something went wrong with that request. Please try again.