优化代码
This commit is contained in:
parent
5870a3814c
commit
e3900b6f9e
@ -162,14 +162,7 @@ export default class Controller extends Eventful {
|
||||
const dy2 = Math.pow(e.dy, 2);
|
||||
const scale = this.option.getScaleRate();
|
||||
const diff = Math.ceil(Math.sqrt(dx2+dy2));
|
||||
|
||||
if (scale > 1) {
|
||||
return true;
|
||||
} else if (diff > 2/scale) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return scale > 1 && (diff > 2/scale);
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
|
Loading…
Reference in New Issue
Block a user