Skip to content

Commit

Permalink
Fix drawing of incomplete intervals (#4842)
Browse files Browse the repository at this point in the history
Incomplete intervals, drawn as orange translucid rectangles, could be drawn over
the track headers on the left side of the capture view. Make sure we clamp
the x coordinate. Tested by introducing fake intervals and making sure they aligned
properly on the timeline and that they did not draw over the track headers.
  • Loading branch information
pierricgimmig authored Sep 20, 2023
1 parent 68c4ae8 commit 4dc9830
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/OrbitGl/TrackContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ void TrackContainer::DrawIncompleteDataIntervals(PrimitiveAssembler& primitive_a
const float world_height = viewport_->GetWorldHeight();

// Actually draw the ranges.
for (const auto& [start_x, end_x] : x_ranges) {
for (auto [start_x, end_x] : x_ranges) {
start_x = std::max(layout_->GetTrackHeaderWidth(), start_x);
const Vec2 pos{start_x, world_start_y};
const Vec2 size{end_x - start_x, world_height};
float z_value = GlCanvas::kZValueIncompleteDataOverlay;
Expand Down

0 comments on commit 4dc9830

Please sign in to comment.