diff --git a/Canvas.js b/Canvas.js index c7fe85f66..d69ea61a4 100644 --- a/Canvas.js +++ b/Canvas.js @@ -673,6 +673,11 @@ function newCanvas () { return false // This instructs the browser not to take the event and scroll the page. } + if (container !== undefined) { + viewPort.applyZoom(delta) + return false + } + /* We try second with floating objects. */ container = canvas.floatingSpace.getContainer({ x: point.x, y: point.y }) @@ -680,12 +685,9 @@ function newCanvas () { if (container !== undefined && container.isWheelable === true) { container.eventHandler.raiseEvent('onMouseWheel', 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 */ - - viewPort.applyZoom(delta) - return false // This instructs the browser not to take the event and scroll the page. } + + return false } catch (err) { if (ERROR_LOG === true) { logger.write('[ERROR] onMouseWheel -> err = ' + err.stack) } } diff --git a/Spaces/ChartSpace.js b/Spaces/ChartSpace.js index 5e0c6a3f7..5d2a5db81 100644 --- a/Spaces/ChartSpace.js +++ b/Spaces/ChartSpace.js @@ -30,6 +30,7 @@ function newChartSpace () { thisObject.container.initialize(MODULE_NAME) thisObject.container.isDraggeable = false + thisObject.container.isWheelable = false return thisObject