mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
make helper mouse functions have consistent interface
This commit is contained in:
parent
6b8b20b911
commit
b40ccd46a9
3 changed files with 5 additions and 5 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);
|
||||
|
|
Loading…
Reference in a new issue