fix: set limits on image comparsion
This commit is contained in:
parent
5a9bc4f459
commit
1b159ff70f
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ function ImageComparison() {
|
||||||
|
|
||||||
const rect = e.currentTarget.getBoundingClientRect();
|
const rect = e.currentTarget.getBoundingClientRect();
|
||||||
const newSliderPosition = ((e.clientX - rect.left) / rect.width) * 100;
|
const newSliderPosition = ((e.clientX - rect.left) / rect.width) * 100;
|
||||||
setSliderPosition(Math.min(100, Math.max(0, newSliderPosition)));
|
setSliderPosition(Math.min(98, Math.max(2, newSliderPosition)));
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue