godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.92k stars 20.16k forks source link

Custom script icons render too small on Retina display #96069

Open samuelfine opened 2 weeks ago

samuelfine commented 2 weeks ago

Tested versions

v4.3.stable.official [77dcf97d8]

System information

Godot v4.3.stable - macOS 14.6.1 - GLES3 (Compatibility) - Intel(R) UHD Graphics 617 - Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz (4 Threads)

Issue description

When setting a custom @icon on a script, the icon renders smaller than expected in the Scene Tree. The icon preview in the FileSystem renders at the correct size.

icon-issue

I'm using a MacBook Air with a high DPI / Retina display:

Screen Width: 1440 pixels Screen Height: 900 pixels DPR (Device Pixel Ratio): 2

Steps to reproduce

@icon ("res://assets/icons/icon_save.svg")
extends Node2D
class_name SaveDataResource

Minimal reproduction project (MRP)

customiconsizeissue.zip

detomon commented 2 weeks ago

Checking "Scale With Editor Scale" in the import tab and then reimporting it should resize the icon to the correct scale.

import

samuelfine commented 2 weeks ago

@detomon Good catch, this does fix the problem for SVG icons! Does lead me to a few additional questions though:

The documentation doesn't specify a filetype, so at the very least it feels like there's an opportunity for providing clearer user guidance.