From d9cb647d78a4f9ec40cada0a3157d56f4c5ed8b6 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Tue, 26 Nov 2024 09:49:07 +0100 Subject: [PATCH] Inspector: Replace click.svg with png Elementa's SVG renderer only works on legacy OpenGL, so this button is invisible on modern versions. This commit fixes that by baking the svg to png and using that instead. Converted using ImageMagick (`convert -density 1200 -resize 48x48 -background none ../../svg/click.svg click.png`) after changing the stroke color to `white`. GitHub: #153 --- .../elementa/components/inspector/Inspector.kt | 6 ++++-- src/main/resources/textures/inspector/click.png | Bin 0 -> 1246 bytes 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/textures/inspector/click.png diff --git a/src/main/kotlin/gg/essential/elementa/components/inspector/Inspector.kt b/src/main/kotlin/gg/essential/elementa/components/inspector/Inspector.kt index 0c5bb876..d483804e 100644 --- a/src/main/kotlin/gg/essential/elementa/components/inspector/Inspector.kt +++ b/src/main/kotlin/gg/essential/elementa/components/inspector/Inspector.kt @@ -82,11 +82,13 @@ class Inspector @JvmOverloads constructor( height = 14.pixels() } childOf titleBlock - SVGComponent.ofResource("/svg/click.svg").constrain { + UIImage.ofResourceCached("/textures/inspector/click.png").constrain { x = SiblingConstraint(10f) y = CenterConstraint() width = AspectConstraint(1f) - height = RelativeConstraint(1f).to(title) as HeightConstraint + height = 12.pixels + }.apply { + textureMinFilter = UIImage.TextureScalingMode.LINEAR }.onMouseClick { event -> event.stopPropagation() isClickSelecting = true diff --git a/src/main/resources/textures/inspector/click.png b/src/main/resources/textures/inspector/click.png new file mode 100644 index 0000000000000000000000000000000000000000..abc2aa74623581f80dc177577e4d024aad996c72 GIT binary patch literal 1246 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweBoc6VW5Sk?NMQuIw*3SviFz3geyK85o#5JY5_^A`Wkzu|HoVT;RC<`@B+J50^Oy?axJI-udXv zr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