awesome-inc / FontAwesome.Sharp

A library for using Font Awesome in WPF & Windows Forms applications
Apache License 2.0
376 stars 87 forks source link

Button content not properly aligned. #98

Closed Sensei6x9 closed 1 year ago

Sensei6x9 commented 1 year ago

Describe the bug In VB.Net WinForms; Button content is not properly aligned in middle. The icon is leaning towards the top even when alignment is set to center.

To Reproduce Set the button's property to this image

mkoertgen commented 1 year ago

Reproducing in VS2022 / net6 using the latest package

Without any icon it looks properly aligned image

Setting an icon image

Now setting alignment properties ImageBeforeText image

TextBeforeImage image

mkoertgen commented 1 year ago

Now I checked with a standard button (screenshotted the icon, and loaded it to the button). Spoiler: Exact the same behaviour

image

mkoertgen commented 1 year ago

Closing this as "won't fix" if it's ok for you @Sensei6x9

Sensei6x9 commented 1 year ago

Sorry @mkoertgen, forgot to visit this issue. Yeah, it's okay, I see now that there is a somewhat minimum button height needed to make it look at least like it's properly aligned.

As always, thank you for a prompt reply.

emccourt commented 7 months ago

Hi, I'm visiting this issue now, as I'm having the same problems with vertical alignment. The icon is significantly closer to the top of the IconButton, even with a small icon compared to a large container.

Here is an example, icon size 48 in a button size 100x100 with no padding (screenshotted then measured in Paint3D to show difference):

I'm also confused by your reply of "the standard Button has the same behavior" @mkoertgen - in the screenshots you posted, the standard Button seems to be vertically centering the icon correctly (text is between the two horizontal lines of the icon), whereas the IconButton is clearly shifted upwards (text now aligns with the bottom horizontal line of the icon)

mkoertgen commented 7 months ago

Hi @emccourt ,

Hm, not sure if I recall correctly. But, yes, now that you are bringing it up again, I see that there is a clear vertical alignment shift between the Button and IconButton screenshots.

Feel free to reopen the issue. Not sure whether I can help much with remediation in the near future.