优化代码
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 dy2 = Math.pow(e.dy, 2);
|
||||||
const scale = this.option.getScaleRate();
|
const scale = this.option.getScaleRate();
|
||||||
const diff = Math.ceil(Math.sqrt(dx2+dy2));
|
const diff = Math.ceil(Math.sqrt(dx2+dy2));
|
||||||
|
return scale > 1 && (diff > 2/scale);
|
||||||
if (scale > 1) {
|
|
||||||
return true;
|
|
||||||
} else if (diff > 2/scale) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mousedown(e) {
|
mousedown(e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user