pandora icon indicating copy to clipboard operation
pandora copied to clipboard

Icons Don't scale

Open pietru2004 opened this issue 2 years ago • 12 comments

if you download svg files and use them as icons... obraz they don't scale down

I basicaly downloaded some svgs from game-icons and well that is how it looks

pietru2004 avatar Sep 05 '23 16:09 pietru2004

@pietru2004 this is a Godot bug - icon .svgs need to be 16x16 pixels. Try the same with

@icon("my-icon.svg") on custom scenes and you see a terrible surprise.

bitbrain avatar Sep 05 '23 16:09 bitbrain

Erm 1 is there fix on horizon for that ? 2 can't you use/allow people to use expand icon property? Example from button obraz

pietru2004 avatar Sep 05 '23 17:09 pietru2004

or use set_icon_region or set_icon_max_width ? Under and above https://docs.godotengine.org/en/stable/classes/class_treeitem.html#class-treeitem-method-set-icon-modulate

pietru2004 avatar Sep 05 '23 17:09 pietru2004

@pietru2004 feel free to raise a pull request!

bitbrain avatar Sep 05 '23 17:09 bitbrain

I would, but my problem is school year that just started and I am in final class I can try, but I can't promise anything

pietru2004 avatar Sep 05 '23 19:09 pietru2004

I tried it out and well obraz obraz 20 seams as good amount of max pixels

pietru2004 avatar Sep 05 '23 20:09 pietru2004

this is 24 obraz I think it could be selectable between 16 and max 28/32 pixels in steps of 4

pietru2004 avatar Sep 05 '23 20:09 pietru2004

I think it would be the same level of ease of base implement as https://github.com/bitbrain/pandora/discussions/107 https://github.com/bitbrain/pandora/issues/110

pietru2004 avatar Sep 05 '23 21:09 pietru2004

@pietru2004 you may also need to take editor scale into account.

bitbrain avatar Sep 06 '23 05:09 bitbrain

I guess it could use editor_scale*desired_pixel_size, so .5 would give 8 pixels and 2 would 32 if input is 16... I would ned to look for way to get interface scale

pietru2004 avatar Sep 06 '23 06:09 pietru2004

so from what I see there is EditorPlugin.get_editor_interface.

And on that you can run get_editor_scale()

pietru2004 avatar Sep 06 '23 13:09 pietru2004

I got once way to use interface to generate mesh preview... obraz so it could be like ei.get_editor_scale()

pietru2004 avatar Sep 06 '23 13:09 pietru2004