Should work with sub-images now

This commit is contained in:
2023-07-05 04:08:22 -04:00
parent dd0655ea3c
commit a0a4bac5e2
7 changed files with 24 additions and 24 deletions

View File

@@ -10,12 +10,12 @@ func main () {
canvas := ggfx.Image[uint8] {
Pix: img.Pix,
Stride: img.Stride,
Bounds: img.Rect,
Rect: img.Rect,
Width: 4,
}
black := []uint8 { 0, 0, 0, 255 }
yellow := []uint8 { 255, 255, 0, 255 }
midpoint := image.Pt(canvas.Bounds.Dx() / 2, canvas.Bounds.Dy() / 2)
midpoint := image.Pt(canvas.Rect.Dx() / 2, canvas.Rect.Dy() / 2)
face := ggfx.Circle(32, 100, midpoint)
canvas.FillPolygon(yellow, face...)

View File

@@ -10,14 +10,14 @@ func main () {
canvas := ggfx.Image[uint8] {
Pix: img.Pix,
Stride: img.Stride,
Bounds: img.Rect,
Rect: img.Rect,
Width: 4,
}
black := []uint8 { 0, 0, 0, 255 }
orange := []uint8 { 255, 48, 0, 255 }
midpoint := image.Pt(canvas.Bounds.Dx() / 2, canvas.Bounds.Dy() / 2)
midpoint := image.Pt(canvas.Rect.Dx() / 2, canvas.Rect.Dy() / 2)
canvas.FillRectangle(orange, canvas.Bounds)
canvas.FillRectangle(orange, canvas.Rect)
for x := 1; x <= 6; x ++ {
point := image.Pt(x, 7 - x)
canvas.FillRectangle(black, image.Rectangle {