JujuAdams / Scribble

Efficient, internationalized, multi-effects text renderer for GameMaker
https://www.jujuadams.com/Scribble/
MIT License
321 stars 47 forks source link

Scribble rectangle isn't updated after .align() #485

Closed LastLifeLeft closed 3 weeks ago

LastLifeLeft commented 11 months ago

The values returned by scribble.get_left(), scribble.get_top(), scribble.get_right() and scribble.get_bottom() aren't updated after scribble.align().

Step to reproduce : replace obj_example_basic with

#event create
//Example looks nicer with interpolation on!
gpu_set_tex_filter(true);

scribble_font_set_default("fnt_test_1");

var _mapstring = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,.-;:_+-*/\\'\"!?~^°<>|(){[]}%&=#@$ÄÖÜäöüß";
font_add_sprite_ext(spr_sprite_font, _mapstring, true, 1);
scribble_font_force_bilinear_filtering("spr_sprite_font", false);

my_scribble = scribble("test string");

#event draw

my_scribble.align(fa_left, fa_bottom);
draw_set_color(c_red);
draw_rectangle(my_scribble.get_left(room_width div 2), my_scribble.get_top(room_height div 2), my_scribble.get_right(room_width div 2), my_scribble.get_bottom(room_height div 2), true);
my_scribble.draw(room_width div 2, room_height div 2);

my_scribble.align(fa_center, fa_top);
draw_set_color(c_blue);
draw_rectangle(my_scribble.get_left(room_width div 2), my_scribble.get_top(room_height div 2), my_scribble.get_right(room_width div 2), my_scribble.get_bottom(room_height div 2), true);
my_scribble.draw(room_width div 2, room_height div 2);
JujuAdams commented 3 weeks ago

https://github.com/JujuAdams/Scribble/commit/d69940158033ec6f61eac8cffe80eecc15292fcd

JujuAdams commented 3 weeks ago

Fix available in 8.8.0: https://github.com/JujuAdams/Scribble/releases/tag/8.8.0