From f8fe89a29ea22544eec8cbdacb28ce5ec09ccf24 Mon Sep 17 00:00:00 2001 From: IllusionMan1212 Date: Mon, 22 Jan 2024 06:55:26 +0200 Subject: [PATCH] zephr/text: text scaling --- zephr/text.odin | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zephr/text.odin b/zephr/text.odin index 2d61ec2..c3f4f00 100644 --- a/zephr/text.odin +++ b/zephr/text.odin @@ -351,6 +351,10 @@ get_glyph_instance_list_from_text :: proc(text: string, font_size: u32, constrai model := identity() scale(&model, Vec3{font_scale, font_scale, 1}) + translate(&model, Vec3{-text_size.x * font_scale / 2, -text_size.y * font_scale / 2, 0}) + scale(&model, Vec3{constraints.scale.x, constraints.scale.y, 1}) + translate(&model, Vec3{text_size.x *font_scale / 2, text_size.y * font_scale / 2, 0}) + // rotate around the center point of the text translate(&model, Vec3{-text_size.x * font_scale / 2, -text_size.y * font_scale / 2, 0}) rotate(&model, constraints.rotation, Vec3{0, 0, 1})