return ruler_offset_;
}
-void View::set_zero_position(pv::util::Timestamp& position)
+void View::set_zero_position(const pv::util::Timestamp& position)
{
- ruler_shift_ = -position;
+ // ruler shift is a negative offset and the new zero position is relative
+ // to the current offset. Hence, we adjust the ruler shift only by the
+ // difference.
+ ruler_shift_ = -(position + (-ruler_shift_));
// Force an immediate update of the offsets
set_offset(offset_, true);
void View::determine_if_header_was_shrunk()
{
- const int header_pane_width = splitter_->sizes().front();
+ const int header_pane_width =
+ splitter_->sizes().front(); // clazy:exclude=detaching-temporary
// Allow for a slight margin of error so that we also accept
// slight differences when e.g. a label name change increased
// splitter to the maximum allowed position.
int splitter_area_width = 0;
- for (int w : splitter_->sizes())
+ for (int w : splitter_->sizes()) // clazy:exclude=range-loop
splitter_area_width += w;
// Make sure the header has enough horizontal space to show all labels fully