Skip to content

Commit 9fb4657

Browse files
authored
Merge pull request #408 from bernhardberger/bernhardberger-patch-1
[BUGFIX] fix blurry mirror (don't use fractional px values)
2 parents 58db0e5 + 114e8a8 commit 9fb4657

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Draggable/Plugins/Mirror/Mirror.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,11 @@ function positionMirror({withFrame = false, initial = false} = {}) {
513513
const x = passedThreshX
514514
? Math.round((sensorEvent.clientX - mirrorOffset.left - scrollOffset.x) / (options.thresholdX || 1)) *
515515
(options.thresholdX || 1)
516-
: lastMovedX;
516+
: Math.round(lastMovedX);
517517
const y = passedThreshY
518518
? Math.round((sensorEvent.clientY - mirrorOffset.top - scrollOffset.y) / (options.thresholdY || 1)) *
519519
(options.thresholdY || 1)
520-
: lastMovedY;
520+
: Math.round(lastMovedY);
521521

522522
if ((options.xAxis && options.yAxis) || initial) {
523523
mirror.style.transform = `translate3d(${x}px, ${y}px, 0)`;

0 commit comments

Comments
 (0)