mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
ui: avoid infinite loop when word-wrapping
This commit fixes an infinite loop in draw_text_full(), happening when there is not enough space to draw even a single a char before trying to word-wrap. Signed-off-by: Luca Bruno <lucab@debian.org>
This commit is contained in:
parent
20f21fb925
commit
0d7860c675
@ -694,6 +694,9 @@ void ui_manager::draw_text_full(render_container *container, const char *origs,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
curwidth -= get_font()->char_width(lineheight, aspect, schar);
|
curwidth -= get_font()->char_width(lineheight, aspect, schar);
|
||||||
|
// if back to 0, there is no space to draw even a single char
|
||||||
|
if (curwidth <= 0)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user