Skip to content

Commit d9cb647

Browse files
authored
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
1 parent 3d0e09d commit d9cb647

File tree

2 files changed

+4
-2
lines changed
  • src/main

2 files changed

+4
-2
lines changed

src/main/kotlin/gg/essential/elementa/components/inspector/Inspector.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ class Inspector @JvmOverloads constructor(
8282
height = 14.pixels()
8383
} childOf titleBlock
8484

85-
SVGComponent.ofResource("/svg/click.svg").constrain {
85+
UIImage.ofResourceCached("/textures/inspector/click.png").constrain {
8686
x = SiblingConstraint(10f)
8787
y = CenterConstraint()
8888
width = AspectConstraint(1f)
89-
height = RelativeConstraint(1f).to(title) as HeightConstraint
89+
height = 12.pixels
90+
}.apply {
91+
textureMinFilter = UIImage.TextureScalingMode.LINEAR
9092
}.onMouseClick { event ->
9193
event.stopPropagation()
9294
isClickSelecting = true
1.22 KB
Loading

0 commit comments

Comments
 (0)