Update canvas

This commit is contained in:
Sasha Koshka 2024-05-26 00:55:20 -04:00
parent bb4080bd73
commit 8f47da654c
2 changed files with 4 additions and 4 deletions

View File

@ -32,8 +32,8 @@ func (this *Canvas) Pen () canvas.Pen {
} }
} }
// Clip returns a sub-canvas of this canvas. // SubCanvas returns a subset of this canvas that points to the same data.
func (this *Canvas) Clip (bounds image.Rectangle) canvas.Canvas { func (this *Canvas) SubCanvas (bounds image.Rectangle) canvas.Canvas {
this.assert() this.assert()
subImage := this.Image.SubImage(bounds) subImage := this.Image.SubImage(bounds)
if subImage == nil { return nil } if subImage == nil { return nil }

View File

@ -86,8 +86,8 @@ func (this *Texture) Close () error {
return nil return nil
} }
// Clip returns a subset of this texture that points to the same data. // SubTexture returns a subset of this texture that points to the same data.
func (this *Texture) Clip (bounds image.Rectangle) canvas.Texture { func (this *Texture) SubTexture (bounds image.Rectangle) canvas.Texture {
clipped := *this clipped := *this
clipped.rect = bounds clipped.rect = bounds
return &clipped return &clipped