Upgrade tomo version

This commit is contained in:
2023-08-24 15:54:22 -04:00
parent 94db4e8ead
commit 77ccde9e9b
6 changed files with 13 additions and 17 deletions

View File

@@ -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()

View File

@@ -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 {