ImVector: added resize() variant with initialization value

This commit is contained in:
omar
2017-08-15 11:41:00 +08:00
parent 032c222d57
commit f8f382221c
2 changed files with 6 additions and 11 deletions

View File

@ -1820,16 +1820,10 @@ void ImFont::SetFallbackChar(ImWchar c)
void ImFont::GrowIndex(int new_size)
{
IM_ASSERT(IndexXAdvance.Size == IndexLookup.Size);
int old_size = IndexLookup.Size;
if (new_size <= old_size)
if (new_size <= IndexLookup.Size)
return;
IndexXAdvance.resize(new_size);
IndexLookup.resize(new_size);
for (int i = old_size; i < new_size; i++)
{
IndexXAdvance[i] = -1.0f;
IndexLookup[i] = (unsigned short)-1;
}
IndexXAdvance.resize(new_size, -1.0f);
IndexLookup.resize(new_size, (unsigned short)-1);
}
void ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst)