All edges working

This commit is contained in:
Luis Fernando Molina committed 2020-02-10 19:32:51 +01:00
1 parent 0936f6c388
commit ac4e95d3fd
2 files changed
+38 -15

No files matched your search

+33 -10
View File
@@ -28,13 +28,6 @@ function newEdgeEditor () {
let onMouseOverEventSubscriptionId
let onMouseNotOverEventSubscriptionId
let mouse = {
position: {
x: 0,
y: 0
}
}
return thisObject
function finalize () {
@@ -44,8 +37,6 @@ function newEdgeEditor () {
thisObject.container.finalize()
thisObject.container = undefined
thisObject.fitFunction = undefined
mouse = undefined
}
function initialize () {
@@ -99,7 +90,39 @@ function newEdgeEditor () {
}
function physics () {
if (thisObject.container.frame.position.x === 0 && thisObject.container.frame.position.y === 0) { return }
switch (whereIsMouseOver) {
case 'top' : {
thisObject.container.parentContainer.frame.position.y = thisObject.container.parentContainer.frame.position.y + thisObject.container.frame.position.y
thisObject.container.parentContainer.frame.height = thisObject.container.parentContainer.frame.height - thisObject.container.frame.position.y
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
break
}
case 'bottom' : {
thisObject.container.parentContainer.frame.height = thisObject.container.parentContainer.frame.height + thisObject.container.frame.position.y
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
break
}
case 'left' : {
thisObject.container.parentContainer.frame.position.x = thisObject.container.parentContainer.frame.position.x + thisObject.container.frame.position.x
thisObject.container.parentContainer.frame.width = thisObject.container.parentContainer.frame.width - thisObject.container.frame.position.x
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
break
}
case 'right' : {
thisObject.container.parentContainer.frame.width = thisObject.container.parentContainer.frame.width + thisObject.container.frame.position.x
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
break
}
}
}
function drawForeground () {
+5 -5
View File
@@ -202,11 +202,11 @@ function newTimeMachine () {
if (event.isUserAction === true) {
let currentDate = getDateFromPoint(event.mousePosition, thisObject.container, timeMachineCoordinateSystem)
let currentRate = getRateFromPoint(event.mousePosition, thisObject.container, timeMachineCoordinateSystem)
thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale
// thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale
recalculateCoordinateSystem()
moveToUserPosition(thisObject.container, currentDate, currentRate, timeMachineCoordinateSystem, false, true, event.mousePosition)
} else {
thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale
// thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale
recalculateCoordinateSystem()
}
thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
@@ -277,9 +277,7 @@ function newTimeMachine () {
container = thisObject.edgeEditor.getContainer(point)
if (container !== undefined) {
if (container.isForThisPurpose(purpose)) {
return container
}
return container
}
if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) {
@@ -395,6 +393,8 @@ function newTimeMachine () {
}
function physics () {
thisObject.edgeEditor.physics()
saveFrame(thisObject.payload, thisObject.container.frame)
if (thisObject.container.frame.isInViewPort()) {
childrenPhysics()