From 77ccde9e9b8a42268ca1b09ff2748e17d22c867a Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 24 Aug 2023 15:54:22 -0400 Subject: [PATCH] Upgrade tomo version --- box.go | 2 +- canvas/canvas.go | 7 +++---- canvas/texture.go | 8 ++++---- go.mod | 3 +-- go.sum | 6 ++---- texture.go | 4 ++-- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/box.go b/box.go index 09401b0..634f3c2 100644 --- a/box.go +++ b/box.go @@ -122,7 +122,7 @@ func (this *box) SetColor (c color.Color) { this.invalidateDraw() } -func (this *box) SetTexture (texture tomo.Texture) { +func (this *box) SetTexture (texture canvas.Texture) { this.texture = xcanvas.AssertTexture(texture) this.determineFillTransparency() this.invalidateDraw() diff --git a/canvas/canvas.go b/canvas/canvas.go index 37dd4ce..8de4e50 100644 --- a/canvas/canvas.go +++ b/canvas/canvas.go @@ -4,7 +4,6 @@ import "image" import "image/color" import "github.com/jezek/xgbutil" import "github.com/jezek/xgb/xproto" -import "git.tebibyte.media/tomo/tomo" import "github.com/jezek/xgbutil/xgraphics" import "git.tebibyte.media/tomo/tomo/canvas" @@ -111,9 +110,9 @@ func (this *pen) Joint (joint canvas.Joint) { this.joint = joint func (this *pen) StrokeWeight (weight int) { this.weight = weight } func (this *pen) StrokeAlign (align canvas.StrokeAlign) { this.align = align } -func (this *pen) Stroke (stroke color.Color) { this.stroke = convertColor(stroke) } -func (this *pen) Fill (fill color.Color) { this.fill = convertColor(fill) } -func (this *pen) Texture (texture tomo.Texture) { this.texture = AssertTexture(texture) } +func (this *pen) Stroke (stroke color.Color) { this.stroke = convertColor(stroke) } +func (this *pen) Fill (fill color.Color) { this.fill = convertColor(fill) } +func (this *pen) Texture (texture canvas.Texture) { this.texture = AssertTexture(texture) } func convertColor (c color.Color) xgraphics.BGRA { r, g, b, a := c.RGBA() diff --git a/canvas/texture.go b/canvas/texture.go index 99cb6e6..d5777d4 100644 --- a/canvas/texture.go +++ b/canvas/texture.go @@ -1,7 +1,7 @@ package xcanvas import "image" -import "git.tebibyte.media/tomo/tomo" +import "git.tebibyte.media/tomo/tomo/canvas" // Texture is a read-only image texture that can be quickly written to a canvas. // It must be closed manually after use. @@ -53,14 +53,14 @@ func (this *Texture) Close () error { } // Clip returns a subset of this texture that points to the same data. -func (this *Texture) Clip (bounds image.Rectangle) tomo.Texture { +func (this *Texture) Clip (bounds image.Rectangle) canvas.Texture { clipped := *this clipped.rect = bounds return &clipped } -// AssertTexture checks if a given tomo.Texture is a texture from this package. -func AssertTexture (unknown tomo.Texture) *Texture { +// AssertTexture checks if a given canvas.Texture is a texture from this package. +func AssertTexture (unknown canvas.Texture) *Texture { if tx, ok := unknown.(*Texture); ok { return tx } else { diff --git a/go.mod b/go.mod index 33feaa8..3add147 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,7 @@ module git.tebibyte.media/tomo/x go 1.20 require ( - git.tebibyte.media/tomo/ggfx v0.4.0 - git.tebibyte.media/tomo/tomo v0.25.0 + git.tebibyte.media/tomo/tomo v0.26.0 git.tebibyte.media/tomo/typeset v0.5.2 git.tebibyte.media/tomo/xgbkb v1.0.1 github.com/jezek/xgb v1.1.0 diff --git a/go.sum b/go.sum index bcca140..f219f48 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ git.tebibyte.media/sashakoshka/xgbkb v1.0.0/go.mod h1:pNcE6TRO93vHd6q42SdwLSTTj25L0Yzggz7yLe0JV6Q= -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.25.0 h1:nFZATsIqLQyGNB1QreVTFhFQjbyBax1hjMff2u1qpxc= -git.tebibyte.media/tomo/tomo v0.25.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps= +git.tebibyte.media/tomo/tomo v0.26.0 h1:JjOb3ZEsGfpkNBe2nVAfZYw/VrDDPqODH/ANZiG4czU= +git.tebibyte.media/tomo/tomo v0.26.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps= git.tebibyte.media/tomo/typeset v0.5.2 h1:qHxN62/VDnrAouOuzxLmLleQNwAebshrfVYvtoOnAG4= git.tebibyte.media/tomo/typeset v0.5.2/go.mod h1:PwDpSdBF3l/EzoIsa2ME7QffVVajnTHZN6l3MHEGe1g= git.tebibyte.media/tomo/xgbkb v1.0.1 h1:b3HDUopjdQp1MZrb5Vpil4bOtk3NnNXtfQW27Blw2kE= diff --git a/texture.go b/texture.go index 7a5f968..21c483c 100644 --- a/texture.go +++ b/texture.go @@ -1,9 +1,9 @@ package x import "image" -import "git.tebibyte.media/tomo/tomo" import "git.tebibyte.media/tomo/x/canvas" +import "git.tebibyte.media/tomo/tomo/canvas" -func (backend Backend) NewTexture (source image.Image) tomo.Texture { +func (backend Backend) NewTexture (source image.Image) canvas.Texture { return xcanvas.NewTextureFrom(source) }