Skip to content

Commit

Permalink
Merge pull request #271 from idbrii/clip-parent
Browse files Browse the repository at this point in the history
ImSequencer: Fix clip when scrolling out of view
  • Loading branch information
CedricGuillemet authored Oct 25, 2022
2 parents abdb6b3 + 0961522 commit ae8925a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ImSequencer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,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 @@ -294,9 +294,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 @@ -315,7 +312,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 All @@ -331,7 +328,7 @@ namespace ImSequencer
{
customHeight = 0;
for (int i = 0; i < *selectedEntry; i++)
customHeight += sequence->GetCustomHeight(i);;
customHeight += sequence->GetCustomHeight(i);
draw_list->AddRectFilled(ImVec2(contentMin.x, contentMin.y + ItemHeight * *selectedEntry + customHeight), ImVec2(contentMin.x + canvas_size.x, contentMin.y + ItemHeight * (*selectedEntry + 1) + customHeight), 0x801080FF, 1.f);
}

Expand Down

0 comments on commit ae8925a

Please sign in to comment.