From e8d5a1edad0292a8400b05a2055eaa99585de1da Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Mon, 15 Jun 2026 20:14:19 +0200 Subject: [PATCH] rename app.width to app.diameter --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 90e4963..75e4d45 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,7 @@ type appOption func(a *app) type app struct { strokes []stroke - width float32 + diameter float32 canvas *ebiten.Image sizeAnchorPos Vec2 historyIndex uintptr @@ -33,7 +33,7 @@ func (a *app) Draw(screen *ebiten.Image) { screen, cursor.x, cursor.y, - a.width/2, + a.diameter/2, 3, color.White, true, @@ -42,7 +42,7 @@ func (a *app) Draw(screen *ebiten.Image) { screen, cursor.x, cursor.y, - a.width/2, + a.diameter/2, 1, color.Black, true, @@ -71,7 +71,7 @@ func (a *app) Update() error { } a.strokes = append(a.strokes, stroke{ points: []Vec2{}, - width: a.width, + width: a.diameter, color: clr, }) } @@ -100,7 +100,7 @@ func (a *app) Update() error { length := float32(math.Sqrt( float64(reltivePos.x) * float64(reltivePos.x) + float64(reltivePos.y) * float64(reltivePos.y), )) - a.width = length * 2.0 + a.diameter = length * 2.0 } return nil @@ -120,7 +120,7 @@ func main() { ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled) ebiten.CursorPosition() whiteboardApp := newApp( func(a *app) { - a.width = 10 + a.diameter = 10 a.canvas = ebiten.NewImage(width, height) a.canvas.Fill(color.White) })