doodle/pkg/drawtool/tools.go
Noah Petherbridge 0c6c77a423 Lemon-shaped Ellipse Tool (WIP)
* 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.
2019-07-14 14:18:44 -07:00

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]
}