ImDrawList: fixed index overflow check broken by AddText(). Added extra assert. (#514)

This commit is contained in:
ocornut
2016-01-30 17:01:10 +01:00
parent a3b00b79f2
commit 2efaa9a86f
2 changed files with 3 additions and 2 deletions

View File

@ -903,7 +903,7 @@ void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos,
CmdBuffer.back().ElemCount -= idx_unused;
_VtxWritePtr -= vtx_unused;
_IdxWritePtr -= idx_unused;
_VtxCurrentIdx = (ImDrawIdx)VtxBuffer.Size;
_VtxCurrentIdx = (unsigned int)VtxBuffer.Size;
}
// This is one of the few function breaking the encapsulation of ImDrawLst, but it is just so useful.