Upgraded to fixed ggfx

This commit is contained in:
Sasha Koshka 2023-07-05 04:11:24 -04:00
parent 53d4683bd1
commit 46d7c71f4b
4 changed files with 6 additions and 6 deletions

View File

@ -31,8 +31,8 @@ func (this *Canvas) Pen () canvas.Pen {
gfx: ggfx.Image[uint8] {
Pix: this.Image.Pix,
Stride: this.Image.Stride,
Bounds: this.Image.Rect,
Width: 4,
Rect: this.Image.Rect,
Width: 4,
},
}
}

View File

@ -1,7 +1,6 @@
package x
import "image"
import "image/color"
import "git.tebibyte.media/tomo/tomo"
import "git.tebibyte.media/tomo/tomo/event"
import "git.tebibyte.media/tomo/tomo/canvas"
@ -130,8 +129,7 @@ func (this *containerBox) Draw (can canvas.Canvas) {
}
// TODO: use shatter algorithm here to optimize amount of pixels drawn
// and not draw over child boxes
for index, tile := range canvas.Shatter(this.bounds, rocks...) {
pen.Fill(color.RGBA { R: uint8(32 * (index + 2)), A: 255 })
for _, tile := range canvas.Shatter(this.bounds, rocks...) {
pen.Rectangle(tile)
}
}

2
go.mod
View File

@ -3,7 +3,7 @@ module git.tebibyte.media/tomo/x
go 1.20
require (
git.tebibyte.media/tomo/ggfx v0.3.0
git.tebibyte.media/tomo/ggfx v0.4.0
git.tebibyte.media/tomo/tomo v0.8.0
git.tebibyte.media/tomo/xgbkb v1.0.1
github.com/jezek/xgb v1.1.0

2
go.sum
View File

@ -3,6 +3,8 @@ git.tebibyte.media/tomo/ggfx v0.2.0 h1:TSWfNQgnnHewwHiGC3VPFssdOIYCfgqCcOiPX4Sgv
git.tebibyte.media/tomo/ggfx v0.2.0/go.mod h1:zPoz8BdVQyG2KhEmeGFQBK66V71i6Kj8oVFbrZaCwRA=
git.tebibyte.media/tomo/ggfx v0.3.0 h1:h+RfairZTt4jT76KwmJN8OcdU7Ew0vFRqMZFqz3iHaE=
git.tebibyte.media/tomo/ggfx v0.3.0/go.mod h1:zPoz8BdVQyG2KhEmeGFQBK66V71i6Kj8oVFbrZaCwRA=
git.tebibyte.media/tomo/ggfx v0.4.0 h1:3aUHeGS/yYWRV/zCDubBsXnik5ygkMnj/VgrM5Z75A4=
git.tebibyte.media/tomo/ggfx v0.4.0/go.mod h1:zPoz8BdVQyG2KhEmeGFQBK66V71i6Kj8oVFbrZaCwRA=
git.tebibyte.media/tomo/tomo v0.4.0 h1:nraUtsmYLSe8BZOolmeBuD+aaMk4duSxI84RqnzflCs=
git.tebibyte.media/tomo/tomo v0.4.0/go.mod h1:lTwjpiHbP4UN/kFw+6FwhG600B+PMKVtMOr7wpd5IUY=
git.tebibyte.media/tomo/tomo v0.5.0 h1:bfHNExPewlt+n7nq8LvNiAbemqSllrCY/tAI08r8sAo=