Button applies the sink offset correctly to icons

This commit is contained in:
Sasha Koshka 2023-03-05 11:20:33 -05:00
parent 7e0d64e8bd
commit 11402cfc25

View File

@ -222,10 +222,6 @@ func (element *Button) drawText () {
offset.Y -= textBounds.Dy() / 2
offset.Y -= textBounds.Min.Y
offset.X -= textBounds.Min.X
if element.pressed {
offset = offset.Add(sink)
}
}
if element.hasIcon {
@ -254,6 +250,9 @@ func (element *Button) drawText () {
}
if element.showText {
if element.pressed {
offset = offset.Add(sink)
}
element.drawer.Draw(element.core, foreground, offset)
}
}