Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
Round offset position to avoid antialiasing problem
Browse files Browse the repository at this point in the history
When the position is a rounded number, some browser doesn't render the
text correctly. Rounding the offset solve the problem.
  • Loading branch information
Giuseppe committed Sep 2, 2013
1 parent 4675a95 commit c941ea2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/directives/rn-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ angular.module('angular-carousel')
window.addEventListener('orientationchange', resize);
// when window is resized (responsive design)
window.addEventListener('resize', resize);

function resize () {
updateContainerWidth();
updateSlidePosition();
Expand Down Expand Up @@ -256,7 +256,7 @@ angular.module('angular-carousel')
/* trigger carousel position update */
skipAnimation = !!forceSkipAnimation || skipAnimation;
if (containerWidth===0) updateContainerWidth();
offset = scope.carouselCollection.getRelativeIndex() * -containerWidth;
offset = Math.round(scope.carouselCollection.getRelativeIndex() * -containerWidth);
if (skipAnimation===true) {
carousel.removeClass('rn-carousel-animate')
.addClass('rn-carousel-noanimate')
Expand Down

0 comments on commit c941ea2

Please sign in to comment.