diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-10-07 21:35:16 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-10-08 10:48:55 +0200 |
| commit | 0bc5bd306f274aa60b075fd8e0167e1ee4f28845 (patch) | |
| tree | 9ebe8abd51efb2653212ddab91179bb51614b064 /go/ui/spinner.go | |
| parent | d4a314f5e2e0e11a1bb30728b47d70ea56a75771 (diff) | |
| download | muhqs-game-0bc5bd306f274aa60b075fd8e0167e1ee4f28845.tar.gz muhqs-game-0bc5bd306f274aa60b075fd8e0167e1ee4f28845.zip | |
switch to new vector API for drawing paths
Diffstat (limited to 'go/ui/spinner.go')
| -rw-r--r-- | go/ui/spinner.go | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/go/ui/spinner.go b/go/ui/spinner.go index 083ec292..e00fcc02 100644 --- a/go/ui/spinner.go +++ b/go/ui/spinner.go @@ -52,26 +52,8 @@ func (s *Spinner) render() *ebiten.Image { strokeOp := &vector.StrokeOptions{} strokeOp.Width = float32(SPINNER_DEFAULT_STROKE) - vertices := []ebiten.Vertex{} - indices := []uint16{} - vertices, indices = path.AppendVerticesAndIndicesForStroke(vertices, indices, strokeOp) - - { - r, g, b, a := s.fg.RGBA() - for i := range vertices { - vertices[i].SrcX = 1 - vertices[i].SrcY = 1 - vertices[i].ColorR = float32(r) - vertices[i].ColorG = float32(g) - vertices[i].ColorB = float32(b) - vertices[i].ColorA = float32(a) - } - } - - op := &ebiten.DrawTrianglesOptions{} - op.AntiAlias = true - op.FillRule = ebiten.FillRuleNonZero - op.ColorScaleMode = ebiten.ColorScaleModePremultipliedAlpha - img.DrawTriangles(vertices, indices, whiteSubImage, op) + drawOp := &vector.DrawPathOptions{} + drawOp.AntiAlias = true + vector.StrokePath(img, &path, strokeOp, drawOp) return img } |
