|
@@ -20,7 +20,7 @@ import UIEvents from './enum/UIEvents.js'
|
|
|
import SelectState from './enum/SelectState.js'
|
|
|
import Constant from './Constant'
|
|
|
import VectorType from './enum/VectorType'
|
|
|
-import { mathUtil } from './MathUtil'
|
|
|
+import MathUtil, { mathUtil } from './MathUtil'
|
|
|
import { wallService } from './Service/WallService'
|
|
|
import History from './History/History'
|
|
|
import { signService } from './Service/SignService'
|
|
@@ -104,7 +104,7 @@ export default class Layer {
|
|
|
const selectItem = stateService.getSelectItem()
|
|
|
if (eventName == null && selectItem) {
|
|
|
stateService.setDraggingItem(selectItem)
|
|
|
- stateService.setFocusItem(selectItem)
|
|
|
+ //stateService.setFocusItem(selectItem)
|
|
|
this.uiControl.showAttributes()
|
|
|
this.uiControl.currentUI = selectItem.type
|
|
|
} else if (eventName == null) {
|
|
@@ -302,10 +302,6 @@ export default class Layer {
|
|
|
}
|
|
|
|
|
|
onMouseUp(e) {
|
|
|
- if (coordinate.defaultCenter == null) {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
const X = e.offsetX || e.layerX
|
|
|
const Y = e.offsetY || e.layerY
|
|
|
|
|
@@ -314,13 +310,21 @@ export default class Layer {
|
|
|
let focusItem = null
|
|
|
|
|
|
if (draggingItem && draggingItem.vectorId) {
|
|
|
- focusItem = {
|
|
|
- vectorId: draggingItem.vectorId,
|
|
|
- type: draggingItem.type,
|
|
|
- cursor: { x: this.lastX, y: this.lastY },
|
|
|
+ if(mathUtil.getDistance({
|
|
|
+ x:this.startX,
|
|
|
+ y:this.startY
|
|
|
+ }, {
|
|
|
+ x:X,
|
|
|
+ y:Y
|
|
|
+ })<Constant.minMovePix){
|
|
|
+ focusItem = {
|
|
|
+ vectorId: draggingItem.vectorId,
|
|
|
+ type: draggingItem.type,
|
|
|
+ cursor: { x: this.lastX, y: this.lastY },
|
|
|
+ }
|
|
|
+ stateService.setFocusItem(focusItem)
|
|
|
+ this.uiControl.showAttributes()
|
|
|
}
|
|
|
- stateService.setFocusItem(focusItem)
|
|
|
- this.uiControl.showAttributes()
|
|
|
}
|
|
|
|
|
|
let position = coordinate.getXYFromScreen({
|
|
@@ -432,9 +436,6 @@ export default class Layer {
|
|
|
}
|
|
|
|
|
|
onWheel(e) {
|
|
|
- if (coordinate.defaultCenter == null) {
|
|
|
- return
|
|
|
- }
|
|
|
e.preventDefault()
|
|
|
const type = e.type
|
|
|
if (type == 'DOMMouseScroll' || type == 'mousewheel') {
|