From 42f74fd3a82d2237c47ee4b0671887e2c4c3e787 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Tue, 23 Jun 2020 16:51:09 -0400 Subject: [PATCH 1/2] Reshape should hit curves, not strokes --- src/helper/selection-tools/reshape-tool.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helper/selection-tools/reshape-tool.js b/src/helper/selection-tools/reshape-tool.js index 527405a3..dace89a5 100644 --- a/src/helper/selection-tools/reshape-tool.js +++ b/src/helper/selection-tools/reshape-tool.js @@ -133,21 +133,21 @@ class ReshapeTool extends paper.Tool { return hitOptions; } /** - * Returns the hit options for strokes and curves of selected objects, which take precedence over + * Returns the hit options for curves of selected objects, which take precedence over * unselected things and fills. * @return {object} See paper.Item.hitTest for definition of options */ getSelectedStrokeHitOptions () { const hitOptions = { segments: false, - stroke: true, + stroke: false, curves: true, handles: false, fill: false, guide: false, tolerance: ReshapeTool.TOLERANCE / paper.view.zoom, match: hitResult => { - if (hitResult.type !== 'stroke' || hitResult.type !== 'curve') return false; + if (hitResult.type !== 'curve') return false; if (!hitResult.item.selected) return false; if (hitResult.item.data && hitResult.item.data.noHover) return false; return true; @@ -249,6 +249,7 @@ class ReshapeTool extends paper.Tool { // or stroke (since those were invisible), just select the whole thing as if they clicked the fill. if (!hitResult.item.selected || hitResult.type === 'fill' || + hitResult.type === 'stroke' || (hitResult.type !== 'segment' && doubleClicked)) { this.mode = ReshapeModes.FILL; this._modeMap[this.mode].onMouseDown(hitProperties); @@ -256,7 +257,6 @@ class ReshapeTool extends paper.Tool { this.mode = ReshapeModes.POINT; this._modeMap[this.mode].onMouseDown(hitProperties); } else if ( - hitResult.type === 'stroke' || hitResult.type === 'curve') { this.mode = ReshapeModes.POINT; this._modeMap[this.mode].addPoint(hitProperties); From 311422334fe0ba80b483ca294ed7dbebe73589f6 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Tue, 28 Jul 2020 13:00:32 -0400 Subject: [PATCH 2/2] Update src/helper/selection-tools/reshape-tool.js Update comment to remove stroke Co-authored-by: adroitwhiz --- src/helper/selection-tools/reshape-tool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helper/selection-tools/reshape-tool.js b/src/helper/selection-tools/reshape-tool.js index dace89a5..96142188 100644 --- a/src/helper/selection-tools/reshape-tool.js +++ b/src/helper/selection-tools/reshape-tool.js @@ -246,7 +246,7 @@ class ReshapeTool extends paper.Tool { }; // If item is not yet selected, don't behave differently depending on if they clicked a segment - // or stroke (since those were invisible), just select the whole thing as if they clicked the fill. + // (since those were invisible), just select the whole thing as if they clicked the fill. if (!hitResult.item.selected || hitResult.type === 'fill' || hitResult.type === 'stroke' ||