From 46d7c71f4b2c46683bebd3e6fbef69793c17ee95 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 5 Jul 2023 04:11:24 -0400 Subject: [PATCH] Upgraded to fixed ggfx --- canvas/canvas.go | 4 ++-- containerbox.go | 4 +--- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/canvas/canvas.go b/canvas/canvas.go index 534838f..f72433b 100644 --- a/canvas/canvas.go +++ b/canvas/canvas.go @@ -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, }, } } diff --git a/containerbox.go b/containerbox.go index 9f1123a..2e5e37a 100644 --- a/containerbox.go +++ b/containerbox.go @@ -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) } } diff --git a/go.mod b/go.mod index 4674fec..a827c1a 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 1b663d0..26d9573 100644 --- a/go.sum +++ b/go.sum @@ -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=