Skip to content

Commit a40f7b4

Browse files
committed
Rounded calculated positions/rotations.
1 parent 8101fa7 commit a40f7b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/directives/parallax.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ directive('duParallax',
1717
}
1818

1919
var translate3d = function(result){
20-
return 'translate3d(' + result.x + 'px, ' + result.y + 'px, 0)';
20+
return 'translate3d(' + Math.round(result.x) + 'px, ' + Math.round(result.y) + 'px, 0)';
2121
};
2222

2323
var rotate = function(result) {
2424
if(!result.rotation) return '';
25-
return ' rotate(' + result.rotation + (angular.isNumber(result.rotation) ? 'deg' : '') + ')';
25+
return ' rotate(' + (angular.isNumber(result.rotation) ? Math.round(result.rotation) + 'deg' : result.rotation) + ')';
2626
};
2727

2828
var applyProperties = function(result, element) {

0 commit comments

Comments
 (0)