MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / paintCursors

Method paintCursors

DSView/pv/view/viewport.cpp:246–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246void Viewport::paintCursors(QPainter &p)
247{
248 const QRect xrect = _view.get_view_rect();
249 auto &cursor_list = _view.get_cursorList();
250
251 if (_view.cursors_shown() && _type == TIME_VIEW) {
252
253 for (auto cursor : cursor_list) {
254 const int64_t cursorX = _view.index2pixel(cursor->index());
255 if (xrect.contains(_view.hover_point().x(), _view.hover_point().y()) &&
256 qAbs(cursorX - _view.hover_point().x()) <= HitCursorMargin)
257 cursor->paint(p, xrect, 1, _view.session().is_stopped_status());
258 else
259 cursor->paint(p, xrect, 0, _view.session().is_stopped_status());
260 }
261 }
262}
263
264void Viewport::paintSignals(QPainter &p, QColor fore, QColor back)
265{

Callers

nothing calls this directly

Calls 7

cursors_shownMethod · 0.80
index2pixelMethod · 0.80
indexMethod · 0.80
is_stopped_statusMethod · 0.80
sessionMethod · 0.80
get_view_rectMethod · 0.45
paintMethod · 0.45

Tested by

no test coverage detected