-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
If the user in control starts constructing a shape and then aborts that construction (by switching tools for example) the points of the incomplete shape are erased. However, this erasure does not trigger any of the event listeners (except for clientListener("deselect") which is not helpful because anytime you click a new point it deselects the previous point). This causes the graph to get out of sync.
Potential solution: track what tool the user has selected, and then track whether a shape is in progress or completed. For example:
- The user selects the polygon tool
this.currentTool = 16; this.shapeInProgress = null - The user creates a point -- addListener(label) => if this.currentTool is a shape creation tool*
this.shapeInProgress = true; this.currentShapePoints.push(label) - The user completes the shape -- addListener(label) label.indexOf('polygon' || 'triangle' || 'circle' etc.
this.shapeInprogress = false; this.currentShapePoints = [] - or the user aborts the shape --- clientListener, mode has changed. if (shapeInProgress) emit remove event for each point in this.currentShapePoints
* this might be tedious to deduce...a lot of tools can be used to create shaoe
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
