TextBox properly gives attributes values to the typeset drawer

This commit is contained in:
Sasha Koshka 2024-07-26 00:27:32 -04:00
parent 4f89b11799
commit 37ec962d1f

View File

@ -109,10 +109,10 @@ func (this *textBox) Draw (can canvas.Canvas) {
if col == nil { col = color.Transparent }
this.drawBorders(can)
pen := can.Pen()
pen.Fill(col)
pen.Texture(texture)
if this.transparent() && this.parent != nil {
this.parent.drawBackgroundPart(can)
}
@ -143,6 +143,7 @@ func (this *textBox) setAttr (attr tomo.Attr, user bool) {
case tomo.AttrFace:
if this.attrFace.Set(attr, user) {
println("face set")
this.drawer.SetFace(attr.Face)
this.invalidateMinimum()
this.invalidateLayout()
@ -150,12 +151,16 @@ func (this *textBox) setAttr (attr tomo.Attr, user bool) {
case tomo.AttrWrap:
if this.attrWrap.Set(attr, user) {
this.drawer.SetWrap(bool(attr))
this.invalidateMinimum()
this.invalidateLayout()
}
case tomo.AttrAlign:
if this.attrAlign.Set(attr, user) {
this.drawer.SetAlign (
typeset.Align(attr.X),
typeset.Align(attr.Y))
this.invalidateDraw()
}