Upgrade tomo version
This commit is contained in:
parent
94db4e8ead
commit
77ccde9e9b
2
box.go
2
box.go
@ -122,7 +122,7 @@ func (this *box) SetColor (c color.Color) {
|
|||||||
this.invalidateDraw()
|
this.invalidateDraw()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *box) SetTexture (texture tomo.Texture) {
|
func (this *box) SetTexture (texture canvas.Texture) {
|
||||||
this.texture = xcanvas.AssertTexture(texture)
|
this.texture = xcanvas.AssertTexture(texture)
|
||||||
this.determineFillTransparency()
|
this.determineFillTransparency()
|
||||||
this.invalidateDraw()
|
this.invalidateDraw()
|
||||||
|
@ -4,7 +4,6 @@ import "image"
|
|||||||
import "image/color"
|
import "image/color"
|
||||||
import "github.com/jezek/xgbutil"
|
import "github.com/jezek/xgbutil"
|
||||||
import "github.com/jezek/xgb/xproto"
|
import "github.com/jezek/xgb/xproto"
|
||||||
import "git.tebibyte.media/tomo/tomo"
|
|
||||||
import "github.com/jezek/xgbutil/xgraphics"
|
import "github.com/jezek/xgbutil/xgraphics"
|
||||||
import "git.tebibyte.media/tomo/tomo/canvas"
|
import "git.tebibyte.media/tomo/tomo/canvas"
|
||||||
|
|
||||||
@ -113,7 +112,7 @@ func (this *pen) StrokeAlign (align canvas.StrokeAlign) { this.align = align
|
|||||||
|
|
||||||
func (this *pen) Stroke (stroke color.Color) { this.stroke = convertColor(stroke) }
|
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) Fill (fill color.Color) { this.fill = convertColor(fill) }
|
||||||
func (this *pen) Texture (texture tomo.Texture) { this.texture = AssertTexture(texture) }
|
func (this *pen) Texture (texture canvas.Texture) { this.texture = AssertTexture(texture) }
|
||||||
|
|
||||||
func convertColor (c color.Color) xgraphics.BGRA {
|
func convertColor (c color.Color) xgraphics.BGRA {
|
||||||
r, g, b, a := c.RGBA()
|
r, g, b, a := c.RGBA()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package xcanvas
|
package xcanvas
|
||||||
|
|
||||||
import "image"
|
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.
|
// Texture is a read-only image texture that can be quickly written to a canvas.
|
||||||
// It must be closed manually after use.
|
// 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.
|
// 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 := *this
|
||||||
clipped.rect = bounds
|
clipped.rect = bounds
|
||||||
return &clipped
|
return &clipped
|
||||||
}
|
}
|
||||||
|
|
||||||
// AssertTexture checks if a given tomo.Texture is a texture from this package.
|
// AssertTexture checks if a given canvas.Texture is a texture from this package.
|
||||||
func AssertTexture (unknown tomo.Texture) *Texture {
|
func AssertTexture (unknown canvas.Texture) *Texture {
|
||||||
if tx, ok := unknown.(*Texture); ok {
|
if tx, ok := unknown.(*Texture); ok {
|
||||||
return tx
|
return tx
|
||||||
} else {
|
} else {
|
||||||
|
3
go.mod
3
go.mod
@ -3,8 +3,7 @@ module git.tebibyte.media/tomo/x
|
|||||||
go 1.20
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.tebibyte.media/tomo/ggfx v0.4.0
|
git.tebibyte.media/tomo/tomo v0.26.0
|
||||||
git.tebibyte.media/tomo/tomo v0.25.0
|
|
||||||
git.tebibyte.media/tomo/typeset v0.5.2
|
git.tebibyte.media/tomo/typeset v0.5.2
|
||||||
git.tebibyte.media/tomo/xgbkb v1.0.1
|
git.tebibyte.media/tomo/xgbkb v1.0.1
|
||||||
github.com/jezek/xgb v1.1.0
|
github.com/jezek/xgb v1.1.0
|
||||||
|
6
go.sum
6
go.sum
@ -1,8 +1,6 @@
|
|||||||
git.tebibyte.media/sashakoshka/xgbkb v1.0.0/go.mod h1:pNcE6TRO93vHd6q42SdwLSTTj25L0Yzggz7yLe0JV6Q=
|
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/tomo v0.26.0 h1:JjOb3ZEsGfpkNBe2nVAfZYw/VrDDPqODH/ANZiG4czU=
|
||||||
git.tebibyte.media/tomo/ggfx v0.4.0/go.mod h1:zPoz8BdVQyG2KhEmeGFQBK66V71i6Kj8oVFbrZaCwRA=
|
git.tebibyte.media/tomo/tomo v0.26.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps=
|
||||||
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/typeset v0.5.2 h1:qHxN62/VDnrAouOuzxLmLleQNwAebshrfVYvtoOnAG4=
|
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/typeset v0.5.2/go.mod h1:PwDpSdBF3l/EzoIsa2ME7QffVVajnTHZN6l3MHEGe1g=
|
||||||
git.tebibyte.media/tomo/xgbkb v1.0.1 h1:b3HDUopjdQp1MZrb5Vpil4bOtk3NnNXtfQW27Blw2kE=
|
git.tebibyte.media/tomo/xgbkb v1.0.1 h1:b3HDUopjdQp1MZrb5Vpil4bOtk3NnNXtfQW27Blw2kE=
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package x
|
package x
|
||||||
|
|
||||||
import "image"
|
import "image"
|
||||||
import "git.tebibyte.media/tomo/tomo"
|
|
||||||
import "git.tebibyte.media/tomo/x/canvas"
|
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)
|
return xcanvas.NewTextureFrom(source)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user