mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 14:02:50 -05:00
commit
7da1c16678
1 changed files with 5 additions and 5 deletions
|
@ -133,21 +133,21 @@ class ReshapeTool extends paper.Tool {
|
||||||
return hitOptions;
|
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.
|
* unselected things and fills.
|
||||||
* @return {object} See paper.Item.hitTest for definition of options
|
* @return {object} See paper.Item.hitTest for definition of options
|
||||||
*/
|
*/
|
||||||
getSelectedStrokeHitOptions () {
|
getSelectedStrokeHitOptions () {
|
||||||
const hitOptions = {
|
const hitOptions = {
|
||||||
segments: false,
|
segments: false,
|
||||||
stroke: true,
|
stroke: false,
|
||||||
curves: true,
|
curves: true,
|
||||||
handles: false,
|
handles: false,
|
||||||
fill: false,
|
fill: false,
|
||||||
guide: false,
|
guide: false,
|
||||||
tolerance: ReshapeTool.TOLERANCE / paper.view.zoom,
|
tolerance: ReshapeTool.TOLERANCE / paper.view.zoom,
|
||||||
match: hitResult => {
|
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.selected) return false;
|
||||||
if (hitResult.item.data && hitResult.item.data.noHover) return false;
|
if (hitResult.item.data && hitResult.item.data.noHover) return false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -246,9 +246,10 @@ class ReshapeTool extends paper.Tool {
|
||||||
};
|
};
|
||||||
|
|
||||||
// If item is not yet selected, don't behave differently depending on if they clicked a segment
|
// 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 ||
|
if (!hitResult.item.selected ||
|
||||||
hitResult.type === 'fill' ||
|
hitResult.type === 'fill' ||
|
||||||
|
hitResult.type === 'stroke' ||
|
||||||
(hitResult.type !== 'segment' && doubleClicked)) {
|
(hitResult.type !== 'segment' && doubleClicked)) {
|
||||||
this.mode = ReshapeModes.FILL;
|
this.mode = ReshapeModes.FILL;
|
||||||
this._modeMap[this.mode].onMouseDown(hitProperties);
|
this._modeMap[this.mode].onMouseDown(hitProperties);
|
||||||
|
@ -256,7 +257,6 @@ class ReshapeTool extends paper.Tool {
|
||||||
this.mode = ReshapeModes.POINT;
|
this.mode = ReshapeModes.POINT;
|
||||||
this._modeMap[this.mode].onMouseDown(hitProperties);
|
this._modeMap[this.mode].onMouseDown(hitProperties);
|
||||||
} else if (
|
} else if (
|
||||||
hitResult.type === 'stroke' ||
|
|
||||||
hitResult.type === 'curve') {
|
hitResult.type === 'curve') {
|
||||||
this.mode = ReshapeModes.POINT;
|
this.mode = ReshapeModes.POINT;
|
||||||
this._modeMap[this.mode].addPoint(hitProperties);
|
this._modeMap[this.mode].addPoint(hitProperties);
|
||||||
|
|
Loading…
Reference in a new issue