davidxuang / FluentIcons

A multi-framework wrapper of https://github.com/microsoft/fluentui-system-icons
MIT License
72 stars 6 forks source link

Change SymbolIcon.MeasureOverride() to fit in small borders #3

Closed cell001nz closed 9 months ago

cell001nz commented 9 months ago

Hi,

I would like to use the nuget package but often the icon font size I want is 22 for example, but the space I want to put it in is 16x16. In a case like this there is enough space to display the icon nicely, though currently it will be rendered partly outside the visible area. This pull request will make the icon display centered in the available space in cases where that space is smaller than the font size.

Hopefully a pic is attached below showing difference, and some sample xaml with icons in various configurations.

Results

`

Old New

`

cell001nz commented 9 months ago

The border style is being excluded in the sample code above for some reason. Here it is:

`