draggTo function implemented at container
This commit is contained in:
1 parent
c01bcefc46
commit
060e2650df
2 files changed
+11
-6
No files matched your search
@@ -744,12 +744,7 @@ function newCanvas () {
|
||||
}
|
||||
|
||||
if (containerBeingDragged !== undefined) {
|
||||
if (containerBeingDragged.notDraggingOnX === false) {
|
||||
containerBeingDragged.frame.position.x = containerBeingDragged.frame.position.x + displaceVector.x
|
||||
}
|
||||
if (containerBeingDragged.notDraggingOnY === false) {
|
||||
containerBeingDragged.frame.position.y = containerBeingDragged.frame.position.y + displaceVector.y
|
||||
}
|
||||
containerBeingDragged.draggTo(displaceVector)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ function newContainer () {
|
||||
isWheelable: false,
|
||||
detectMouseOver: false,
|
||||
name: undefined,
|
||||
draggTo: draggTo,
|
||||
initialize: initialize,
|
||||
finalize: finalize,
|
||||
connectToParent: connectToParent,
|
||||
@@ -184,4 +185,13 @@ function newContainer () {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function draggTo (point) {
|
||||
if (thisObject.notDraggingOnX === false) {
|
||||
thisObject.frame.position.x = thisObject.frame.position.x + point.x
|
||||
}
|
||||
if (thisObject.notDraggingOnY === false) {
|
||||
thisObject.frame.position.y = thisObject.frame.position.y + point.y
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user