Replace references to Canvas.Clip
This commit is contained in:
parent
c92377f50b
commit
398ad08867
6
box.go
6
box.go
@ -358,7 +358,7 @@ func (this *box) drawBorders (can canvas.Canvas) {
|
||||
rectangle := func (x0, y0, x1, y1 int, c color.Color) {
|
||||
area := image.Rect(x0, y0, x1, y1)
|
||||
if transparent(c) && this.parent != nil {
|
||||
this.parent.drawBackgroundPart(can.Clip(area))
|
||||
this.parent.drawBackgroundPart(can.SubCanvas(area))
|
||||
}
|
||||
pen.Fill(c)
|
||||
pen.Rectangle(area)
|
||||
@ -426,7 +426,7 @@ func (this *box) doDraw () {
|
||||
if this.canvas == nil { return }
|
||||
if this.drawer != nil {
|
||||
this.drawBorders(this.canvas)
|
||||
this.drawer.Draw(this.canvas.Clip(this.innerClippingBounds))
|
||||
this.drawer.Draw(this.canvas.SubCanvas(this.innerClippingBounds))
|
||||
}
|
||||
}
|
||||
|
||||
@ -439,7 +439,7 @@ func (this *box) doLayout () {
|
||||
if this.parent == nil { this.canvas = nil; return }
|
||||
parentCanvas := this.parent.canvas()
|
||||
if parentCanvas == nil { this.canvas = nil; return }
|
||||
this.canvas = parentCanvas.Clip(this.bounds)
|
||||
this.canvas = parentCanvas.SubCanvas(this.bounds)
|
||||
}
|
||||
|
||||
func (this *box) setParent (parent parent) {
|
||||
|
@ -31,5 +31,5 @@ func (this *canvasBox) Invalidate () {
|
||||
func (this *canvasBox) Draw (can canvas.Canvas) {
|
||||
this.box.Draw(can)
|
||||
this.userDrawer.Draw (
|
||||
can.Clip(this.padding.Apply(this.innerClippingBounds)))
|
||||
can.SubCanvas(this.padding.Apply(this.innerClippingBounds)))
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ func (this *containerBox) Draw (can canvas.Canvas) {
|
||||
rocks[index] = box.Bounds()
|
||||
}
|
||||
for _, tile := range canvas.Shatter(this.bounds, rocks...) {
|
||||
clipped := can.Clip(tile)
|
||||
clipped := can.SubCanvas(tile)
|
||||
if this.transparent() && this.parent != nil {
|
||||
this.parent.drawBackgroundPart(clipped)
|
||||
}
|
||||
|
Reference in New Issue
Block a user