Skip to content

Commit

Permalink
Inspector: Replace click.svg with png
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Johni0702 authored Nov 26, 2024
1 parent 3d0e09d commit d9cb647
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added src/main/resources/textures/inspector/click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d9cb647

Please sign in to comment.