Skip to content

Commit 692ef20

Browse files
bernhardbergerzjffun
authored andcommitted
Update Mirror.js
Add Math.round() to prevent blurry mirror in Chrome.
1 parent e6fa782 commit 692ef20

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)