File tree 3 files changed +6
-3
lines changed
3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
v0.9.4 (WIP):
2
2
3
- nothing yet
3
+ BUGFIX: Canvas: Remember index of first command buffer to not miss updating any used (#260)
4
4
5
5
v0.9.3 (2023-10-14):
6
6
Original file line number Diff line number Diff line change @@ -445,6 +445,8 @@ void ImGuiEx::Canvas::EnterLocalSpace()
445
445
if ((!m_DrawList->CmdBuffer .empty () && m_DrawList->CmdBuffer .back ().ElemCount > 0 ) || m_DrawList->_Splitter ._Count > 1 )
446
446
m_DrawList->AddCallback (ImDrawCallback_ImCanvas, nullptr );
447
447
448
+ m_DrawListFirstCommandIndex = ImMax (m_DrawList->CmdBuffer .Size - 1 , 0 );
449
+
448
450
# if defined(IMGUI_HAS_VIEWPORT)
449
451
auto window = ImGui::GetCurrentWindow ();
450
452
window->Pos = ImVec2 (0 .0f , 0 .0f );
@@ -523,7 +525,7 @@ void ImGuiEx::Canvas::LeaveLocalSpace()
523
525
}
524
526
525
527
// Move clip rectangles to screen space.
526
- for (int i = m_DrawListCommadBufferSize ; i < m_DrawList->CmdBuffer .size (); ++i)
528
+ for (int i = m_DrawListFirstCommandIndex ; i < m_DrawList->CmdBuffer .size (); ++i)
527
529
{
528
530
auto & command = m_DrawList->CmdBuffer [i];
529
531
command.ClipRect .x = command.ClipRect .x * m_View.Scale + m_ViewTransformPosition.x ;
@@ -542,7 +544,7 @@ void ImGuiEx::Canvas::LeaveLocalSpace()
542
544
}
543
545
544
546
// Move clip rectangles to screen space.
545
- for (int i = m_DrawListCommadBufferSize ; i < m_DrawList->CmdBuffer .size (); ++i)
547
+ for (int i = m_DrawListFirstCommandIndex ; i < m_DrawList->CmdBuffer .size (); ++i)
546
548
{
547
549
auto & command = m_DrawList->CmdBuffer [i];
548
550
command.ClipRect .x = command.ClipRect .x + m_ViewTransformPosition.x ;
Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ struct Canvas
236
236
Range* m_CurrentRange = nullptr ;
237
237
# endif
238
238
239
+ int m_DrawListFirstCommandIndex = 0 ;
239
240
int m_DrawListCommadBufferSize = 0 ;
240
241
int m_DrawListStartVertexIndex = 0 ;
241
242
You can’t perform that action at this time.
0 commit comments