Update canvas
This commit is contained in:
parent
bb4080bd73
commit
8f47da654c
@ -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
|
||||
|
Reference in New Issue
Block a user