Merge branch 'develop' into addLine

This commit is contained in:
DD 2017-08-25 11:35:05 -04:00
commit 7989387078
5 changed files with 7 additions and 7 deletions

View file

@ -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}`);
}

View file

@ -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

View file

@ -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);

View file

@ -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"

View file

@ -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);