mirror of
https://github.com/holub/mame
synced 2025-04-24 09:20:02 +03:00
ui/menu.h: Refactor probably-unsafe code referencing temporary object
This commit is contained in:
parent
a1962fb222
commit
816e975d25
@ -278,11 +278,11 @@ protected:
|
||||
float maxwidth(origwidth);
|
||||
for (Iter it = begin; it != end; ++it)
|
||||
{
|
||||
std::string_view const &line(*it);
|
||||
std::string_view const line(*it);
|
||||
if (!line.empty())
|
||||
{
|
||||
text_layout layout(*ui().get_font(), text_size * m_last_aspect, text_size, 1.0, justify, wrap);
|
||||
layout.add_text(std::string_view(*it), rgb_t::white(), rgb_t::black());
|
||||
layout.add_text(line, rgb_t::white(), rgb_t::black());
|
||||
maxwidth = (std::max)(layout.actual_width(), maxwidth);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user