SecondHalfGames / yakui

yakui is a declarative Rust UI library for games
Apache License 2.0
222 stars 18 forks source link

Fix text renderer #131

Closed Uriopass closed 6 months ago

Uriopass commented 6 months ago

The row height was never summed to itself so from the third row onwards would appear in the same height as the second row

The code is therefore simplied to always track the max_height attained by any given glyph which results in the correct behavior

Fixes https://github.com/SecondHalfGames/yakui/issues/112

Tested with

        for i in 0..100 {
            text(100.0 - i as f32, "the fox jumped over the lazy dog");
        }

in renderdoc

Before: image

After: image