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.
|
// 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 }
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user