X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Fview.cpp;h=6ea8cc0af30eea06c6fbc9e7523bf1e8ca257c1c;hb=c23b29d67ed68c1a899000bf0049056fe9f51a62;hp=9c793bb8e635c4443c7b762186f1969df0752886;hpb=b42d25c43e52c900cbdd3e5cde0282961b8721e7;p=pulseview.git diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 9c793bb8..6ea8cc0a 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -161,6 +161,15 @@ void View::show_cursors(bool show) _viewport->update(); } +void View::centre_cursors() +{ + const double time_width = _scale * _viewport->width(); + _cursors.first().set_time(_offset + time_width * 0.4); + _cursors.second().set_time(_offset + time_width * 0.6); + _ruler->update(); + _viewport->update(); +} + CursorPair& View::cursors() { return _cursors;