diff --git a/code/font/VEFontCache/LICENSE.md b/code/font/vefontcache_/LICENSE.md similarity index 100% rename from code/font/VEFontCache/LICENSE.md rename to code/font/vefontcache_/LICENSE.md diff --git a/code/font/VEFontCache/LRU.odin b/code/font/vefontcache_/LRU.odin similarity index 100% rename from code/font/VEFontCache/LRU.odin rename to code/font/vefontcache_/LRU.odin diff --git a/code/font/VEFontCache/Readme.md b/code/font/vefontcache_/Readme.md similarity index 100% rename from code/font/VEFontCache/Readme.md rename to code/font/vefontcache_/Readme.md diff --git a/code/font/VEFontCache/VEFontCache.odin b/code/font/vefontcache_/_vefontcache.odin similarity index 99% rename from code/font/VEFontCache/VEFontCache.odin rename to code/font/vefontcache_/_vefontcache.odin index b1864e9..b7b9046 100644 --- a/code/font/VEFontCache/VEFontCache.odin +++ b/code/font/vefontcache_/_vefontcache.odin @@ -61,6 +61,7 @@ Context :: struct { default_curve_quality : i32, text_shape_adv : b32, + snap_shape_pos : b32, debug_print : b32, debug_print_verbose : b32, @@ -135,6 +136,7 @@ startup :: proc( ctx : ^Context, parser_kind : ParserKind, atlas_params := InitAtlasParams_Default, glyph_draw_params := InitGlyphDrawParams_Default, shape_cache_params := InitShapeCacheParams_Default, + snap_shape_position : b32 = true, default_curve_quality : u32 = 3, entires_reserve : u32 = 512, temp_path_reserve : u32 = 1024, @@ -147,6 +149,8 @@ startup :: proc( ctx : ^Context, parser_kind : ParserKind, ctx.backing = allocator context.allocator = ctx.backing + snap_shape_pos = snap_shape_position + if default_curve_quality == 0 { default_curve_quality = 3 } diff --git a/code/font/VEFontCache/atlas.odin b/code/font/vefontcache_/atlas.odin similarity index 100% rename from code/font/VEFontCache/atlas.odin rename to code/font/vefontcache_/atlas.odin diff --git a/code/font/VEFontCache/docs/Readme.md b/code/font/vefontcache_/docs/Readme.md similarity index 100% rename from code/font/VEFontCache/docs/Readme.md rename to code/font/vefontcache_/docs/Readme.md diff --git a/code/font/VEFontCache/docs/draw_text_codepaths.pur b/code/font/vefontcache_/docs/draw_text_codepaths.pur similarity index 100% rename from code/font/VEFontCache/docs/draw_text_codepaths.pur rename to code/font/vefontcache_/docs/draw_text_codepaths.pur diff --git a/code/font/VEFontCache/docs/original/LICENSE.md b/code/font/vefontcache_/docs/original/LICENSE.md similarity index 100% rename from code/font/VEFontCache/docs/original/LICENSE.md rename to code/font/vefontcache_/docs/original/LICENSE.md diff --git a/code/font/VEFontCache/docs/original/README.md b/code/font/vefontcache_/docs/original/README.md similarity index 100% rename from code/font/VEFontCache/docs/original/README.md rename to code/font/vefontcache_/docs/original/README.md diff --git a/code/font/VEFontCache/draw.odin b/code/font/vefontcache_/draw.odin similarity index 100% rename from code/font/VEFontCache/draw.odin rename to code/font/vefontcache_/draw.odin diff --git a/code/font/VEFontCache/mappings.odin b/code/font/vefontcache_/mappings.odin similarity index 100% rename from code/font/VEFontCache/mappings.odin rename to code/font/vefontcache_/mappings.odin diff --git a/code/font/VEFontCache/misc.odin b/code/font/vefontcache_/misc.odin similarity index 100% rename from code/font/VEFontCache/misc.odin rename to code/font/vefontcache_/misc.odin diff --git a/code/font/VEFontCache/parser.odin b/code/font/vefontcache_/parser.odin similarity index 100% rename from code/font/VEFontCache/parser.odin rename to code/font/vefontcache_/parser.odin diff --git a/code/font/VEFontCache/shaped_text.odin b/code/font/vefontcache_/shaped_text.odin similarity index 95% rename from code/font/VEFontCache/shaped_text.odin rename to code/font/vefontcache_/shaped_text.odin index 96b8cd1..d265f76 100644 --- a/code/font/VEFontCache/shaped_text.odin +++ b/code/font/vefontcache_/shaped_text.odin @@ -118,11 +118,11 @@ shape_text_uncached :: proc( ctx : ^Context, font : FontID, text_utf8 : string, advance, _ := parser_get_codepoint_horizontal_metrics( & entry.parser_info, codepoint ) append( & output.positions, Vec2 { - ceil(position.x), + ctx.snap_shape_pos ? ceil(position.x) : position.x, position.y }) - position.x += ceil(f32(advance) * entry.size_scale) + position.x += ctx.snap_shape_pos ? ceil(f32(advance) * entry.size_scale) : f32(advance) * entry.size_scale prev_codepoint = codepoint } diff --git a/code/font/VEFontCache/shaper.odin b/code/font/vefontcache_/shaper.odin similarity index 100% rename from code/font/VEFontCache/shaper.odin rename to code/font/vefontcache_/shaper.odin diff --git a/code/sectr/engine/render.odin b/code/sectr/engine/render.odin index 85570f0..9c36ca1 100644 --- a/code/sectr/engine/render.odin +++ b/code/sectr/engine/render.odin @@ -173,7 +173,7 @@ render_mode_screenspace :: proc( screen_extent : Extents2, screen_ui : ^UI_State content := str_fmt( format, ..args ) text_size := measure_text_size( content, default_font, 14.0, 0.0 ) - debug_draw_text( content, position, 10.0 ) + debug_draw_text( content, position, 12.0 ) debug.draw_debug_text_y += text_size.y } @@ -186,7 +186,7 @@ render_mode_screenspace :: proc( screen_extent : Extents2, screen_ui : ^UI_State debug_draw_text( fps_msg, fps_msg_pos, fps_size, color = Color_Red ) } - if false { + if true { debug_text( "Screen Width : %v", screen_size.x ) debug_text( "Screen Height: %v", screen_size.y ) debug_text( "frametime_target_ms : %f ms", frametime_target_ms ) @@ -200,7 +200,7 @@ render_mode_screenspace :: proc( screen_extent : Extents2, screen_ui : ^UI_State debug_text( "Replaying Input") } - if false + if true { using input_events diff --git a/code/sectr/engine/update.odin b/code/sectr/engine/update.odin index b5216e5..68d78d0 100644 --- a/code/sectr/engine/update.odin +++ b/code/sectr/engine/update.odin @@ -243,6 +243,7 @@ update :: proc( delta_time : f64 ) -> b32 return clamp(binary_search_closest(levels, zoom), 0, len(levels) - 1) } + config.cam_zoom_mode = .Digital switch config.cam_zoom_mode { case .Smooth: @@ -339,8 +340,8 @@ update :: proc( delta_time : f64 ) -> b32 // test_hover_n_click() // test_draggable() // test_text_box() - test_parenting( & default_layout, & frame_style_default ) - // test_whitespace_ast( & default_layout, & frame_style_default ) + // test_parenting( & default_layout, & frame_style_default ) + test_whitespace_ast( & default_layout, & frame_style_default ) } //endregion Workspace Imgui Tick