fix slow panning in image cropper
This commit is contained in:
@@ -193,8 +193,8 @@ export default class Cropper extends React.Component {
|
|||||||
|
|
||||||
// Perform image panning.
|
// Perform image panning.
|
||||||
translate(pageX, pageY) {
|
translate(pageX, pageY) {
|
||||||
const dX = pageX - this.mouseX;
|
const dX = (pageX - this.mouseX) / this.state.zoom;
|
||||||
const dY = pageY - this.mouseY;
|
const dY = (pageY - this.mouseY) / this.state.zoom;
|
||||||
|
|
||||||
this.mouseX = pageX;
|
this.mouseX = pageX;
|
||||||
this.mouseY = pageY;
|
this.mouseY = pageY;
|
||||||
|
|||||||
Reference in New Issue
Block a user