Skip to content

Commit

Permalink
Fix clip when scrolling ImSequencer out of view
Browse files Browse the repository at this point in the history
Related to #57: clip rectangle not correct when slots out of parent
window.

This is a reimplementation of #57 which no longer merges cleanly.
  • Loading branch information
idbrii committed Oct 22, 2022
1 parent 4d46aa5 commit 0961522
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ImSequencer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ namespace ImSequencer
*/
// clip content

draw_list->PushClipRect(childFramePos, childFramePos + childFrameSize);
draw_list->PushClipRect(childFramePos, childFramePos + childFrameSize, true);

// draw item names in the legend rect on the left
size_t customHeight = 0;
Expand All @@ -291,9 +291,6 @@ namespace ImSequencer
customHeight += sequence->GetCustomHeight(i);
}

// clipping rect so items bars are not visible in the legend on the left when scrolled
//

// slots background
customHeight = 0;
for (int i = 0; i < sequenceCount; i++)
Expand All @@ -312,7 +309,7 @@ namespace ImSequencer
customHeight += localCustomHeight;
}

draw_list->PushClipRect(childFramePos + ImVec2(float(legendWidth), 0.f), childFramePos + childFrameSize);
draw_list->PushClipRect(childFramePos + ImVec2(float(legendWidth), 0.f), childFramePos + childFrameSize, true);

// vertical frame lines in content area
for (int i = sequence->GetFrameMin(); i <= sequence->GetFrameMax(); i += frameStep)
Expand Down

0 comments on commit 0961522

Please sign in to comment.