changeset 1295:76ca976804d0

fix: scale x to keep aspect ratio instead of y
author sam <sam@basx.dev>
date Mon, 05 Aug 2024 17:17:31 +0700
parents 9ff18be62a1e
children da3bbd587fe1
files semicongine/text.nim
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/text.nim	Sun Aug 04 23:52:37 2024 +0700
+++ b/semicongine/text.nim	Mon Aug 05 17:17:31 2024 +0700
@@ -37,7 +37,7 @@
     color {.ShaderOutput.}: Vec4f
     descriptorSets {.DescriptorSets.}: (TextboxDescriptorSet, )
     vertexCode = """void main() {
-  gl_Position = vec4(position * vec3(1, textbox.aspectratio, 1) * textbox.scale + textbox.position, 1.0);
+  gl_Position = vec4(position * vec3(1 / textbox.aspectratio, 1, 1) * textbox.scale + textbox.position, 1.0);
   fragmentUv = uv;
 }  """
     fragmentCode = """void main() {