Noah Petherbridge
0c6c77a423
* Add initial Ellipse Tool to the Editor Mode. Currently there's something wrong with the algorithm and the ellipses have a sort of 'lemon shape' to them. * Refactor the IterLine/IterLine2 functions to be more consistent. IterLine used to be the raw algorithm that took a bunch of coordinate numbers and IterLine2 took two render.Point's and was the main one used throughout the app. Now, IterLine takes the two Points and the raw algorithm function removed.
30 lines
470 B
Go
30 lines
470 B
Go
package drawtool
|
|
|
|
// Tool is a draw mode for an editable Canvas.
|
|
type Tool int
|
|
|
|
// Draw modes for editable Canvas.
|
|
const (
|
|
PencilTool Tool = iota // draw pixels where the mouse clicks
|
|
LineTool
|
|
RectTool
|
|
EllipseTool
|
|
ActorTool // drag and move actors
|
|
LinkTool
|
|
EraserTool
|
|
)
|
|
|
|
var toolNames = []string{
|
|
"Pencil",
|
|
"Line",
|
|
"Rectangle",
|
|
"Ellipse",
|
|
"Doodad", // readable name for ActorTool
|
|
"Link",
|
|
"Eraser",
|
|
}
|
|
|
|
func (t Tool) String() string {
|
|
return toolNames[t]
|
|
}
|