mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
Merge branch 'develop' into addLine
This commit is contained in:
commit
7989387078
5 changed files with 7 additions and 7 deletions
|
@ -82,9 +82,9 @@ class Blobbiness {
|
|||
blob.resizeCursorIfNeeded(event.point);
|
||||
if (event.event.button > 0) return; // only first mouse button
|
||||
if (blob.brush === Blobbiness.BROAD) {
|
||||
blob.broadBrushHelper.onBroadMouseDrag(event, blob.options);
|
||||
blob.broadBrushHelper.onBroadMouseDrag(event, blob.tool, blob.options);
|
||||
} else if (blob.brush === Blobbiness.SEGMENT) {
|
||||
blob.segmentBrushHelper.onSegmentMouseDrag(event, blob.options);
|
||||
blob.segmentBrushHelper.onSegmentMouseDrag(event, blob.tool, blob.options);
|
||||
} else {
|
||||
log.warn(`Brush type does not exist: ${blob.brush}`);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ class Blobbiness {
|
|||
if (blob.brush === Blobbiness.BROAD) {
|
||||
lastPath = blob.broadBrushHelper.onBroadMouseUp(event, blob.tool, blob.options);
|
||||
} else if (blob.brush === Blobbiness.SEGMENT) {
|
||||
lastPath = blob.segmentBrushHelper.onSegmentMouseUp(event);
|
||||
lastPath = blob.segmentBrushHelper.onSegmentMouseUp(event, blob.tool, blob.options);
|
||||
} else {
|
||||
log.warn(`Brush type does not exist: ${blob.brush}`);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class BroadBrushHelper {
|
|||
this.lastPoint = this.secondLastPoint = event.point;
|
||||
}
|
||||
|
||||
onBroadMouseDrag (event, options) {
|
||||
onBroadMouseDrag (event, tool, options) {
|
||||
const step = (event.delta).normalize(options.brushSize / 2);
|
||||
|
||||
// Move the first point out away from the drag so that the end of the path is rounded
|
||||
|
|
|
@ -36,7 +36,7 @@ class SegmentBrushHelper {
|
|||
this.lastPoint = event.point;
|
||||
}
|
||||
|
||||
onSegmentMouseDrag (event, options) {
|
||||
onSegmentMouseDrag (event, tool, options) {
|
||||
if (event.event.button > 0) return; // only first mouse button
|
||||
|
||||
const step = (event.delta).normalize(options.brushSize / 2);
|
||||
|
|
|
@ -33,7 +33,7 @@ class BrushMode extends React.Component {
|
|||
}
|
||||
}
|
||||
shouldComponentUpdate () {
|
||||
return false; // Logic only component
|
||||
return false; // Static component, for now
|
||||
}
|
||||
activateTool () {
|
||||
// TODO: Instead of clearing selection, consider a kind of "draw inside"
|
||||
|
|
|
@ -33,7 +33,7 @@ class EraserMode extends React.Component {
|
|||
}
|
||||
}
|
||||
shouldComponentUpdate () {
|
||||
return false; // Logic only component
|
||||
return false; // Static component, for now
|
||||
}
|
||||
activateTool () {
|
||||
this.props.canvas.addEventListener('mousewheel', this.onScroll);
|
||||
|
|
Loading…
Reference in a new issue