Compare commits

..

No commits in common. "74fd3fdd558f1bacb003787d35da355a32a613a5" and "c92377f50b6a5dd23554d2945c3696e586c3b1e7" have entirely different histories.

3 changed files with 6 additions and 6 deletions

6
box.go
View File

@ -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.SubCanvas(area))
this.parent.drawBackgroundPart(can.Clip(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.SubCanvas(this.innerClippingBounds))
this.drawer.Draw(this.canvas.Clip(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.SubCanvas(this.bounds)
this.canvas = parentCanvas.Clip(this.bounds)
}
func (this *box) setParent (parent parent) {

View File

@ -31,5 +31,5 @@ func (this *canvasBox) Invalidate () {
func (this *canvasBox) Draw (can canvas.Canvas) {
this.box.Draw(can)
this.userDrawer.Draw (
can.SubCanvas(this.padding.Apply(this.innerClippingBounds)))
can.Clip(this.padding.Apply(this.innerClippingBounds)))
}

View File

@ -104,7 +104,7 @@ func (this *containerBox) Add (child tomo.Object) {
this.invalidateMinimum()
}
func (this *containerBox) Remove (child tomo.Object) {
func (this *containerBox) Delete (child tomo.Object) {
box := assertAnyBox(child.GetBox())
index := indexOf(this.children, tomo.Box(box))
if index < 0 { return }
@ -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.SubCanvas(tile)
clipped := can.Clip(tile)
if this.transparent() && this.parent != nil {
this.parent.drawBackgroundPart(clipped)
}