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 Aug 7, 2021
1 parent 55743dc commit 6f60505
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 @@ -271,7 +271,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 @@ -295,9 +295,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 @@ -316,7 +313,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 6f60505

Please sign in to comment.