mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-01-09 14:12:13 -05:00
Remove wheel listeners from brush and eraser
This commit is contained in:
parent
d4b28a8817
commit
62526889c9
4 changed files with 2 additions and 12 deletions
|
@ -225,20 +225,16 @@ class PaintEditorComponent extends React.Component {
|
||||||
onUpdateSvg={this.props.onUpdateSvg}
|
onUpdateSvg={this.props.onUpdateSvg}
|
||||||
/>
|
/>
|
||||||
<BrushMode
|
<BrushMode
|
||||||
canvas={this.state.canvas}
|
|
||||||
onUpdateSvg={this.props.onUpdateSvg}
|
onUpdateSvg={this.props.onUpdateSvg}
|
||||||
/>
|
/>
|
||||||
<EraserMode
|
<EraserMode
|
||||||
canvas={this.state.canvas}
|
|
||||||
onUpdateSvg={this.props.onUpdateSvg}
|
onUpdateSvg={this.props.onUpdateSvg}
|
||||||
/>
|
/>
|
||||||
<PenMode
|
<PenMode
|
||||||
canvas={this.state.canvas}
|
|
||||||
onUpdateSvg={this.props.onUpdateSvg}
|
onUpdateSvg={this.props.onUpdateSvg}
|
||||||
/>
|
/>
|
||||||
{/* Text mode will go here */}
|
{/* Text mode will go here */}
|
||||||
<LineMode
|
<LineMode
|
||||||
canvas={this.state.canvas}
|
|
||||||
onUpdateSvg={this.props.onUpdateSvg}
|
onUpdateSvg={this.props.onUpdateSvg}
|
||||||
/>
|
/>
|
||||||
<OvalMode
|
<OvalMode
|
||||||
|
|
|
@ -70,8 +70,6 @@ BrushMode.propTypes = {
|
||||||
brushModeState: PropTypes.shape({
|
brushModeState: PropTypes.shape({
|
||||||
brushSize: PropTypes.number.isRequired
|
brushSize: PropTypes.number.isRequired
|
||||||
}),
|
}),
|
||||||
canvas: PropTypes.instanceOf(Element).isRequired,
|
|
||||||
changeBrushSize: PropTypes.func.isRequired,
|
|
||||||
clearSelectedItems: PropTypes.func.isRequired,
|
clearSelectedItems: PropTypes.func.isRequired,
|
||||||
colorState: PropTypes.shape({
|
colorState: PropTypes.shape({
|
||||||
fillColor: PropTypes.string,
|
fillColor: PropTypes.string,
|
||||||
|
|
|
@ -56,8 +56,6 @@ class EraserMode extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
EraserMode.propTypes = {
|
EraserMode.propTypes = {
|
||||||
canvas: PropTypes.instanceOf(Element).isRequired,
|
|
||||||
changeBrushSize: PropTypes.func.isRequired,
|
|
||||||
clearSelectedItems: PropTypes.func.isRequired,
|
clearSelectedItems: PropTypes.func.isRequired,
|
||||||
eraserModeState: PropTypes.shape({
|
eraserModeState: PropTypes.shape({
|
||||||
brushSize: PropTypes.number.isRequired
|
brushSize: PropTypes.number.isRequired
|
||||||
|
|
|
@ -189,7 +189,6 @@ class LineMode extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deactivateTool () {
|
deactivateTool () {
|
||||||
this.props.canvas.removeEventListener('mousewheel', this.onScroll);
|
|
||||||
this.tool.remove();
|
this.tool.remove();
|
||||||
this.tool = null;
|
this.tool = null;
|
||||||
if (this.hitResult) {
|
if (this.hitResult) {
|
||||||
|
@ -211,7 +210,6 @@ class LineMode extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
LineMode.propTypes = {
|
LineMode.propTypes = {
|
||||||
canvas: PropTypes.instanceOf(Element).isRequired,
|
|
||||||
clearSelectedItems: PropTypes.func.isRequired,
|
clearSelectedItems: PropTypes.func.isRequired,
|
||||||
colorState: PropTypes.shape({
|
colorState: PropTypes.shape({
|
||||||
fillColor: PropTypes.string,
|
fillColor: PropTypes.string,
|
||||||
|
|
Loading…
Reference in a new issue