Redesign structure of application

This commit is contained in:
Michał Gdula 2024-01-25 15:57:10 +00:00
parent be4c6c7fcf
commit 105785e6c0
9 changed files with 305 additions and 544 deletions

22
penTool.go Normal file
View file

@ -0,0 +1,22 @@
package main
import (
raylib "github.com/gen2brain/raylib-go/raylib"
)
type penTool struct {
Color raylib.Color
Size float32
Opacity float32
Points []raylib.Vector2
}
func (p *penTool) Draw(offset raylib.Vector2) {
for i := 0; i < len(p.Points)-1; i++ {
startPoint := raylib.Vector2Add(p.Points[i], offset)
endPoint := raylib.Vector2Add(p.Points[i+1], offset)
raylib.DrawLineEx(startPoint, endPoint, p.Size, p.Color)
raylib.DrawCircle(int32(startPoint.X), int32(startPoint.Y), p.Size/2, p.Color)
}
}