Compare commits
No commits in common. "74fd3fdd558f1bacb003787d35da355a32a613a5" and "c92377f50b6a5dd23554d2945c3696e586c3b1e7" have entirely different histories.
74fd3fdd55
...
c92377f50b
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) {
|
rectangle := func (x0, y0, x1, y1 int, c color.Color) {
|
||||||
area := image.Rect(x0, y0, x1, y1)
|
area := image.Rect(x0, y0, x1, y1)
|
||||||
if transparent(c) && this.parent != nil {
|
if transparent(c) && this.parent != nil {
|
||||||
this.parent.drawBackgroundPart(can.SubCanvas(area))
|
this.parent.drawBackgroundPart(can.Clip(area))
|
||||||
}
|
}
|
||||||
pen.Fill(c)
|
pen.Fill(c)
|
||||||
pen.Rectangle(area)
|
pen.Rectangle(area)
|
||||||
@ -426,7 +426,7 @@ func (this *box) doDraw () {
|
|||||||
if this.canvas == nil { return }
|
if this.canvas == nil { return }
|
||||||
if this.drawer != nil {
|
if this.drawer != nil {
|
||||||
this.drawBorders(this.canvas)
|
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 }
|
if this.parent == nil { this.canvas = nil; return }
|
||||||
parentCanvas := this.parent.canvas()
|
parentCanvas := this.parent.canvas()
|
||||||
if parentCanvas == nil { this.canvas = nil; return }
|
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) {
|
func (this *box) setParent (parent parent) {
|
||||||
|
@ -31,5 +31,5 @@ func (this *canvasBox) Invalidate () {
|
|||||||
func (this *canvasBox) Draw (can canvas.Canvas) {
|
func (this *canvasBox) Draw (can canvas.Canvas) {
|
||||||
this.box.Draw(can)
|
this.box.Draw(can)
|
||||||
this.userDrawer.Draw (
|
this.userDrawer.Draw (
|
||||||
can.SubCanvas(this.padding.Apply(this.innerClippingBounds)))
|
can.Clip(this.padding.Apply(this.innerClippingBounds)))
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ func (this *containerBox) Add (child tomo.Object) {
|
|||||||
this.invalidateMinimum()
|
this.invalidateMinimum()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *containerBox) Remove (child tomo.Object) {
|
func (this *containerBox) Delete (child tomo.Object) {
|
||||||
box := assertAnyBox(child.GetBox())
|
box := assertAnyBox(child.GetBox())
|
||||||
index := indexOf(this.children, tomo.Box(box))
|
index := indexOf(this.children, tomo.Box(box))
|
||||||
if index < 0 { return }
|
if index < 0 { return }
|
||||||
@ -167,7 +167,7 @@ func (this *containerBox) Draw (can canvas.Canvas) {
|
|||||||
rocks[index] = box.Bounds()
|
rocks[index] = box.Bounds()
|
||||||
}
|
}
|
||||||
for _, tile := range canvas.Shatter(this.bounds, rocks...) {
|
for _, tile := range canvas.Shatter(this.bounds, rocks...) {
|
||||||
clipped := can.SubCanvas(tile)
|
clipped := can.Clip(tile)
|
||||||
if this.transparent() && this.parent != nil {
|
if this.transparent() && this.parent != nil {
|
||||||
this.parent.drawBackgroundPart(clipped)
|
this.parent.drawBackgroundPart(clipped)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user