@ -460,10 +460,16 @@ void ImDrawList::UpdateClipRect()
}
// Try to merge with previous command if it matches, else use current command
ImDrawCmd * prev_cmd = CmdBuffer . Size > 1 ? curr_cmd - 1 : NULL ;
if ( curr_cmd - > ElemCount = = 0 & & prev_cmd & & memcmp ( & prev_cmd - > ClipRect , & curr_clip_rect , sizeof ( ImVec4 ) ) = = 0 & & prev_cmd - > TextureId = = GetCurrentTextureId ( ) & & prev_cmd - > UserCallback = = NULL )
if ( curr_cmd - > ElemCount = = 0 & & CmdBuffer . Size > 1 )
{
ImDrawCmd * prev_cmd = curr_cmd - 1 ;
if ( memcmp ( & prev_cmd - > ClipRect , & curr_clip_rect , sizeof ( ImVec4 ) ) = = 0 & & prev_cmd - > VtxOffset = = _VtxCurrentOffset & & prev_cmd - > TextureId = = GetCurrentTextureId ( ) & & prev_cmd - > UserCallback = = NULL )
{
CmdBuffer . pop_back ( ) ;
else
return ;
}
}
curr_cmd - > ClipRect = curr_clip_rect ;
}
@ -479,10 +485,16 @@ void ImDrawList::UpdateTextureID()
}
// Try to merge with previous command if it matches, else use current command
ImDrawCmd * prev_cmd = CmdBuffer . Size > 1 ? curr_cmd - 1 : NULL ;
if ( curr_cmd - > ElemCount = = 0 & & prev_cmd & & prev_cmd - > TextureId = = curr_texture_id & & memcmp ( & prev_cmd - > ClipRect , & GetCurrentClipRect ( ) , sizeof ( ImVec4 ) ) = = 0 & & prev_cmd - > UserCallback = = NULL )
if ( curr_cmd - > ElemCount = = 0 & & CmdBuffer . Size > 1 )
{
ImDrawCmd * prev_cmd = curr_cmd - 1 ;
if ( prev_cmd - > TextureId = = curr_texture_id & & memcmp ( & prev_cmd - > ClipRect , & GetCurrentClipRect ( ) , sizeof ( ImVec4 ) ) = = 0 & & prev_cmd - > VtxOffset = = _VtxCurrentOffset & & prev_cmd - > UserCallback = = NULL )
{
CmdBuffer . pop_back ( ) ;
else
return ;
}
}
curr_cmd - > TextureId = curr_texture_id ;
}