From d4b28a8817941a9a4a4338453b28d6689756e565 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Fri, 27 Oct 2017 10:16:13 -0400 Subject: [PATCH] Remove scroll action on eraser and brush --- src/containers/brush-mode.jsx | 15 +-------------- src/containers/eraser-mode.jsx | 14 +------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/containers/brush-mode.jsx b/src/containers/brush-mode.jsx index f525deab..88a1ac16 100644 --- a/src/containers/brush-mode.jsx +++ b/src/containers/brush-mode.jsx @@ -17,8 +17,7 @@ class BrushMode extends React.Component { super(props); bindAll(this, [ 'activateTool', - 'deactivateTool', - 'onScroll' + 'deactivateTool' ]); this.blob = new Blobbiness( this.props.onUpdateSvg, this.props.clearSelectedItems); @@ -48,9 +47,6 @@ class BrushMode extends React.Component { // TODO: Instead of clearing selection, consider a kind of "draw inside" // analogous to how selection works with eraser clearSelection(this.props.clearSelectedItems); - - // TODO: This is temporary until a component that provides the brush size is hooked up - this.props.canvas.addEventListener('mousewheel', this.onScroll); this.blob.activateTool({ isEraser: false, ...this.props.colorState, @@ -58,17 +54,8 @@ class BrushMode extends React.Component { }); } deactivateTool () { - this.props.canvas.removeEventListener('mousewheel', this.onScroll); this.blob.deactivateTool(); } - onScroll (event) { - if (event.deltaY < 0) { - this.props.changeBrushSize(this.props.brushModeState.brushSize + 1); - } else if (event.deltaY > 0 && this.props.brushModeState.brushSize > 1) { - this.props.changeBrushSize(this.props.brushModeState.brushSize - 1); - } - return true; - } render () { return ( 0 && this.props.eraserModeState.brushSize > 1) { - this.props.changeBrushSize(this.props.eraserModeState.brushSize - 1); - } - } render () { return (