|
@@ -91,11 +91,9 @@ export class FloorView extends SGraphyView {
|
|
*/
|
|
*/
|
|
protected onMouseDown(event: MouseEvent): void {
|
|
protected onMouseDown(event: MouseEvent): void {
|
|
let se = new SMouseEvent(event);
|
|
let se = new SMouseEvent(event);
|
|
- if (this.spaceKey) {
|
|
|
|
- if (se.buttons & SMouseButton.LeftButton) {
|
|
|
|
- this._leftKeyPos.x = se.x;
|
|
|
|
- this._leftKeyPos.y = se.y;
|
|
|
|
- }
|
|
|
|
|
|
+ if (se.buttons & SMouseButton.LeftButton) {
|
|
|
|
+ this._leftKeyPos.x = se.x;
|
|
|
|
+ this._leftKeyPos.y = se.y;
|
|
} else {
|
|
} else {
|
|
super.onMouseDown(event);
|
|
super.onMouseDown(event);
|
|
}
|
|
}
|
|
@@ -111,14 +109,14 @@ export class FloorView extends SGraphyView {
|
|
if (this.moveable) {
|
|
if (this.moveable) {
|
|
// 按左键移动
|
|
// 按左键移动
|
|
let se = new SMouseEvent(event);
|
|
let se = new SMouseEvent(event);
|
|
- if (this.spaceKey) {
|
|
|
|
- if (se.buttons & SMouseButton.LeftButton) {
|
|
|
|
|
|
+ if (se.buttons & SMouseButton.LeftButton) {
|
|
|
|
+ if (this.spaceKey) {
|
|
this.origin.x += se.x - this._leftKeyPos.x;
|
|
this.origin.x += se.x - this._leftKeyPos.x;
|
|
this.origin.y += se.y - this._leftKeyPos.y;
|
|
this.origin.y += se.y - this._leftKeyPos.y;
|
|
- this._leftKeyPos.x = se.x;
|
|
|
|
- this._leftKeyPos.y = se.y;
|
|
|
|
- return;
|
|
|
|
}
|
|
}
|
|
|
|
+ this._leftKeyPos.x = se.x;
|
|
|
|
+ this._leftKeyPos.y = se.y;
|
|
|
|
+ return;
|
|
} else {
|
|
} else {
|
|
super.onMouseMove(event);
|
|
super.onMouseMove(event);
|
|
}
|
|
}
|