Skip to content

Commit

Permalink
Merge pull request mediaelement#684 from JeffreyATW/master
Browse files Browse the repository at this point in the history
Adding rounding to volume slider left, top, and and width setters
  • Loading branch information
johndyer committed Dec 31, 2012
2 parents 9df016c + 6279d08 commit a58d439
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/mep-feature-volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
newTop = totalHeight - (totalHeight * volume);

// handle
volumeHandle.css('top', totalPosition.top + newTop - (volumeHandle.height() / 2));
volumeHandle.css('top', Math.round(totalPosition.top + newTop - (volumeHandle.height() / 2)));

// show the current visibility
volumeCurrent.height(totalHeight - newTop );
Expand All @@ -99,10 +99,10 @@
newLeft = totalWidth * volume;

// handle
volumeHandle.css('left', totalPosition.left + newLeft - (volumeHandle.width() / 2));
volumeHandle.css('left', Math.round(totalPosition.left + newLeft - (volumeHandle.width() / 2)));

// rezize the current part of the volume bar
volumeCurrent.width( newLeft );
volumeCurrent.width( Math.round(newLeft) );
}
},
handleVolumeMove = function(e) {
Expand Down Expand Up @@ -218,4 +218,4 @@
}
});

})(mejs.$);
})(mejs.$);

0 comments on commit a58d439

Please sign in to comment.