TextBox properly gives attributes values to the typeset drawer
This commit is contained in:
parent
4f89b11799
commit
37ec962d1f
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user