File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ v0.10.0 (WIP):
1212
1313 BUGFIX: Editor: Don't call Reasume/Suspend on invisible canvas (#255)
1414
15+ BUGFIX: Canvas: Remember index of first command buffer to not miss updating any used (#260)
1516
1617v0.9.2 (2023-09-01):
1718
Original file line number Diff line number Diff line change @@ -445,6 +445,8 @@ void ImGuiEx::Canvas::EnterLocalSpace()
445445 if ((!m_DrawList->CmdBuffer .empty () && m_DrawList->CmdBuffer .back ().ElemCount > 0 ) || m_DrawList->_Splitter ._Count > 1 )
446446 m_DrawList->AddCallback (ImDrawCallback_ImCanvas, nullptr );
447447
448+ m_DrawListFirstCommandIndex = ImMax (m_DrawList->CmdBuffer .Size - 1 , 0 );
449+
448450# if defined(IMGUI_HAS_VIEWPORT)
449451 auto window = ImGui::GetCurrentWindow ();
450452 window->Pos = ImVec2 (0 .0f , 0 .0f );
@@ -523,7 +525,7 @@ void ImGuiEx::Canvas::LeaveLocalSpace()
523525 }
524526
525527 // 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)
527529 {
528530 auto & command = m_DrawList->CmdBuffer [i];
529531 command.ClipRect .x = command.ClipRect .x * m_View.Scale + m_ViewTransformPosition.x ;
@@ -542,7 +544,7 @@ void ImGuiEx::Canvas::LeaveLocalSpace()
542544 }
543545
544546 // 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)
546548 {
547549 auto & command = m_DrawList->CmdBuffer [i];
548550 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
236236 Range* m_CurrentRange = nullptr ;
237237# endif
238238
239+ int m_DrawListFirstCommandIndex = 0 ;
239240 int m_DrawListCommadBufferSize = 0 ;
240241 int m_DrawListStartVertexIndex = 0 ;
241242
You can’t perform that action at this time.
0 commit comments