Open AdamSlayer opened 3 months ago
The same happens with measure_text() and populate_font_cache(), problem is in the cache_glyph() function. Minimal reproduction:
measure_text()
populate_font_cache()
cache_glyph()
use macroquad::text::measure_text; #[macroquad::main("test")] async fn main() { measure_text("place the entry portal", None, 358, 1.0); }
358 is the exact value, it works fine with 357. When called more than once, it will fail even with smaller values:
358
357
use macroquad::text::measure_text; #[macroquad::main("test")] async fn main() { measure_text("place the entry portal", None, 200, 1.0); measure_text("place the entry portal", None, 201, 1.0); measure_text("place the entry portal", None, 202, 1.0); }
The size at which is starts failing also depends on the text, for example, for "text", it starts to fail at 581 text size.
581
use macroquad::text::measure_text; #[macroquad::main("test")] async fn main() { measure_text("text", None, 581, 1.0); }
The same happens with
measure_text()
andpopulate_font_cache()
, problem is in thecache_glyph()
function. Minimal reproduction:358
is the exact value, it works fine with357
. When called more than once, it will fail even with smaller values:The size at which is starts failing also depends on the text, for example, for "text", it starts to fail at
581
text size.