Button applies the sink offset correctly to icons
This commit is contained in:
parent
7e0d64e8bd
commit
11402cfc25
@ -222,10 +222,6 @@ func (element *Button) drawText () {
|
|||||||
offset.Y -= textBounds.Dy() / 2
|
offset.Y -= textBounds.Dy() / 2
|
||||||
offset.Y -= textBounds.Min.Y
|
offset.Y -= textBounds.Min.Y
|
||||||
offset.X -= textBounds.Min.X
|
offset.X -= textBounds.Min.X
|
||||||
|
|
||||||
if element.pressed {
|
|
||||||
offset = offset.Add(sink)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if element.hasIcon {
|
if element.hasIcon {
|
||||||
@ -254,6 +250,9 @@ func (element *Button) drawText () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if element.showText {
|
if element.showText {
|
||||||
|
if element.pressed {
|
||||||
|
offset = offset.Add(sink)
|
||||||
|
}
|
||||||
element.drawer.Draw(element.core, foreground, offset)
|
element.drawer.Draw(element.core, foreground, offset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user