state

package
v0.0.0-...-e90a610 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Types

type BrushTool

type BrushTool struct{}

BrushTool is the Concrete State

func (*BrushTool) MouseDown

func (b *BrushTool) MouseDown()

func (*BrushTool) MouseUp

func (b *BrushTool) MouseUp()

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas is the Context that satisfy Open Closed Principle Open for extension, cloused for modification

func (*Canvas) GetCurrentTool

func (c *Canvas) GetCurrentTool() Tool

func (*Canvas) MouseDown

func (c *Canvas) MouseDown()

func (*Canvas) MouseUp

func (c *Canvas) MouseUp()

func (*Canvas) SetCurrentTool

func (c *Canvas) SetCurrentTool(tool Tool)

type SelectionTool

type SelectionTool struct{}

SelectionTool is the Concrete State

func (*SelectionTool) MouseDown

func (s *SelectionTool) MouseDown()

func (*SelectionTool) MouseUp

func (s *SelectionTool) MouseUp()

type Tool

type Tool interface {
	MouseDown()
	MouseUp()
}

Tool is the State

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL