MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / setViewportLeftDisplayNs

Method setViewportLeftDisplayNs

pj_widgets/src/Timeline.cpp:1272–1280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1270}
1271
1272void Timeline::setViewportLeftDisplayNs(qint64 display_ns) {
1273 if (view_ == nullptr || view_->horizontalScrollBar() == nullptr) {
1274 return;
1275 }
1276 // QScrollBar::setValue clamps to [min,max], so an out-of-range position (e.g.
1277 // a wider window than at save time) lands at the nearest reachable edge.
1278 const double scene_x = TimelineScene::nsToPx(display_ns, viewport_);
1279 view_->horizontalScrollBar()->setValue(static_cast<int>(std::llround(scene_x)));
1280}
1281
1282int Timeline::nameColumnWidth() const {
1283 if (name_splitter_ == nullptr) {

Callers 2

TESTFunction · 0.80

Calls 2

horizontalScrollBarMethod · 0.80
setValueMethod · 0.45

Tested by 1

TESTFunction · 0.64