Changes is Mouse Wheel
This commit is contained in:
1 parent
01202baec6
commit
a9c1dd6ecc
7 files changed
+29
-22
No files matched your search
@@ -53,16 +53,18 @@
|
||||
container.frame.position.y = viewPort.visibleArea.bottomLeft.y
|
||||
}
|
||||
|
||||
function onMouseWheel (pDelta) {
|
||||
function onMouseWheel (event) {
|
||||
delta = event.wheelDelta
|
||||
|
||||
if (viewPort.isMinZoom() === false) { return } // We only make this button to work at the min zoom level.
|
||||
|
||||
if (pDelta < 0) {
|
||||
pDelta = -0.1
|
||||
if (delta < 0) {
|
||||
delta = -0.1
|
||||
} else {
|
||||
pDelta = 0.1
|
||||
delta = 0.1
|
||||
}
|
||||
|
||||
thisObject.aspectRatio.y = thisObject.aspectRatio.y + pDelta
|
||||
thisObject.aspectRatio.y = thisObject.aspectRatio.y + delta
|
||||
thisObject.aspectRatio.y = Math.round(thisObject.aspectRatio.y * 100) / 100
|
||||
|
||||
if (thisObject.aspectRatio.y < MIN_Y_ASPECT_RATIO) {
|
||||
|
||||
@@ -572,10 +572,12 @@ function newCanvas () {
|
||||
y: event.pageY - window.canvasApp.topMargin
|
||||
}
|
||||
|
||||
event.mousePosition = point
|
||||
|
||||
let panelContainer = canvas.panelsSpace.getContainer({ x: point.x, y: point.y })
|
||||
|
||||
if (panelContainer !== undefined && panelContainer.isWheelable === true) {
|
||||
panelContainer.eventHandler.raiseEvent('Mouse Wheel', event.wheelDelta)
|
||||
panelContainer.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
return false // This instructs the browser not to take the event and scroll the page.
|
||||
}
|
||||
|
||||
@@ -593,7 +595,7 @@ function newCanvas () {
|
||||
let bottomContainer = canvas.bottomSpace.getContainer({ x: point.x, y: point.y })
|
||||
|
||||
if (bottomContainer !== undefined && bottomContainer.isWheeleable === true) {
|
||||
bottomContainer.eventHandler.raiseEvent('Mouse Wheel', event.wheelDelta)
|
||||
bottomContainer.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
return false // This instructs the browser not to take the event and scroll the page.
|
||||
}
|
||||
|
||||
@@ -602,7 +604,7 @@ function newCanvas () {
|
||||
let chartContainer = canvas.chartSpace.getContainer({ x: point.x, y: point.y })
|
||||
|
||||
if (chartContainer !== undefined && chartContainer.isWheeleable === true) {
|
||||
chartContainer.eventHandler.raiseEvent('Mouse Wheel', event.wheelDelta)
|
||||
chartContainer.eventHandler.raiseEvent('Mouse Wheel', event)
|
||||
return false // This instructs the browser not to take the event and scroll the page.
|
||||
} else {
|
||||
/* If all the above fails, we fallback into applying zoom to the viewPort */
|
||||
|
||||
@@ -138,14 +138,15 @@
|
||||
isInitialized = true
|
||||
}
|
||||
|
||||
function onMouseWheel (pDelta) {
|
||||
if (pDelta > 0) {
|
||||
pDelta = -1
|
||||
function onMouseWheel (event) {
|
||||
delta = event.wheelDelta
|
||||
if (delta > 0) {
|
||||
delta = -1
|
||||
} else {
|
||||
pDelta = 1
|
||||
delta = 1
|
||||
}
|
||||
|
||||
firstVisibleCard = firstVisibleCard + pDelta
|
||||
firstVisibleCard = firstVisibleCard + delta
|
||||
|
||||
let availableSlots = visibleProductCards.length
|
||||
|
||||
|
||||
@@ -28,11 +28,12 @@
|
||||
thisObject.container.eventHandler.listenToEvent('Mouse Wheel', onMouseWheel)
|
||||
}
|
||||
|
||||
function onMouseWheel (pDelta) {
|
||||
if (pDelta < 0) {
|
||||
pDelta = -0.1
|
||||
function onMouseWheel (event) {
|
||||
delta = event.wheelDelta
|
||||
if (delta < 0) {
|
||||
delta = -0.1
|
||||
} else {
|
||||
pDelta = 0.1
|
||||
delta = 0.1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -29,8 +29,9 @@ function newTimeScale () {
|
||||
thisObject.container.eventHandler.listenToEvent('Mouse Wheel', onMouseWheel)
|
||||
}
|
||||
|
||||
function onMouseWheel (pDelta) {
|
||||
if (pDelta < 0) {
|
||||
function onMouseWheel (event) {
|
||||
delta = event.wheelDelta
|
||||
if (delta < 0) {
|
||||
thisObject.lenghtPercentage = thisObject.lenghtPercentage - 10
|
||||
if (thisObject.lenghtPercentage < 50) { thisObject.lenghtPercentage = 50 }
|
||||
} else {
|
||||
|
||||
@@ -27,7 +27,7 @@ function newChartSpace () {
|
||||
thisObject.container.initialize(MODULE_NAME)
|
||||
|
||||
thisObject.container.frame.width = CHART_SPACE_WIDTH
|
||||
thisObject.container.frame.height = CHART_SPACE_HEIGHT
|
||||
thisObject.container.frame.height = CHART_SPACE_HEIGHT * canvas.bottomSpace.chartAspectRatio.aspectRatio.y
|
||||
|
||||
thisObject.container.frame.position.x = browserCanvas.width / 2 - thisObject.container.frame.width / 2
|
||||
thisObject.container.frame.position.y = browserCanvas.height / 2 - thisObject.container.frame.height / 2
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ function newTimeMachine () {
|
||||
|
||||
timelineChart.container.connectToParent(thisObject.container, true, true)
|
||||
|
||||
timelineChart.container.frame.height = thisObject.container.frame.height * 1 * canvas.bottomSpace.chartAspectRatio.aspectRatio.y
|
||||
timelineChart.container.frame.height = thisObject.container.frame.height
|
||||
|
||||
timelineChart.container.frame.position.x = thisObject.container.frame.width / 2 - timelineChart.container.frame.width / 2
|
||||
timelineChart.container.frame.position.y = timelineChart.container.frame.height * SEPARATION_BETWEEN_TIMELINE_CHARTS * position
|
||||
@@ -137,7 +137,7 @@ function newTimeMachine () {
|
||||
|
||||
timelineChart.container.connectToParent(thisObject.container, true, true)
|
||||
|
||||
timelineChart.container.frame.height = thisObject.container.frame.height * 1 * canvas.bottomSpace.chartAspectRatio.aspectRatio.y
|
||||
timelineChart.container.frame.height = thisObject.container.frame.height
|
||||
|
||||
timelineChart.container.frame.position.x = thisObject.container.frame.width / 2 - timelineChart.container.frame.width / 2
|
||||
timelineChart.container.frame.position.y = timelineChart.container.frame.height * SEPARATION_BETWEEN_TIMELINE_CHARTS * position
|
||||
|
||||
Reference in new issue
Block a user