Compare commits
2 Commits
c0c4bdb266
...
8f47da654c
Author | SHA1 | Date | |
---|---|---|---|
8f47da654c | |||
bb4080bd73 |
@ -32,8 +32,8 @@ func (this *Canvas) Pen () canvas.Pen {
|
||||
}
|
||||
}
|
||||
|
||||
// Clip returns a sub-canvas of this canvas.
|
||||
func (this *Canvas) Clip (bounds image.Rectangle) canvas.Canvas {
|
||||
// SubCanvas returns a subset of this canvas that points to the same data.
|
||||
func (this *Canvas) SubCanvas (bounds image.Rectangle) canvas.Canvas {
|
||||
this.assert()
|
||||
subImage := this.Image.SubImage(bounds)
|
||||
if subImage == nil { return nil }
|
||||
|
@ -86,8 +86,8 @@ func (this *Texture) Close () error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Clip returns a subset of this texture that points to the same data.
|
||||
func (this *Texture) Clip (bounds image.Rectangle) canvas.Texture {
|
||||
// SubTexture returns a subset of this texture that points to the same data.
|
||||
func (this *Texture) SubTexture (bounds image.Rectangle) canvas.Texture {
|
||||
clipped := *this
|
||||
clipped.rect = bounds
|
||||
return &clipped
|
||||
|
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module git.tebibyte.media/tomo/x
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
git.tebibyte.media/tomo/tomo v0.31.0
|
||||
git.tebibyte.media/tomo/tomo v0.33.0
|
||||
git.tebibyte.media/tomo/typeset v0.7.1
|
||||
git.tebibyte.media/tomo/xgbkb v1.0.1
|
||||
github.com/jezek/xgb v1.1.0
|
||||
|
4
go.sum
4
go.sum
@ -1,6 +1,6 @@
|
||||
git.tebibyte.media/sashakoshka/xgbkb v1.0.0/go.mod h1:pNcE6TRO93vHd6q42SdwLSTTj25L0Yzggz7yLe0JV6Q=
|
||||
git.tebibyte.media/tomo/tomo v0.31.0 h1:LHPpj3AWycochnC8F441aaRNS6Tq6w6WnBrp/LGjyhM=
|
||||
git.tebibyte.media/tomo/tomo v0.31.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps=
|
||||
git.tebibyte.media/tomo/tomo v0.33.0 h1:BBm1oRsogBLeqVKeevNqG9RPCOdmbGeiQM/9hd2GHE8=
|
||||
git.tebibyte.media/tomo/tomo v0.33.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps=
|
||||
git.tebibyte.media/tomo/typeset v0.7.1 h1:aZrsHwCG5ZB4f5CruRFsxLv5ezJUCFUFsQJJso2sXQ8=
|
||||
git.tebibyte.media/tomo/typeset v0.7.1/go.mod h1:PwDpSdBF3l/EzoIsa2ME7QffVVajnTHZN6l3MHEGe1g=
|
||||
git.tebibyte.media/tomo/xgbkb v1.0.1 h1:b3HDUopjdQp1MZrb5Vpil4bOtk3NnNXtfQW27Blw2kE=
|
||||
|
Reference in New Issue
Block a user