| 1261 | } |
| 1262 | |
| 1263 | qint64 Timeline::viewportLeftDisplayNs() const { |
| 1264 | // The horizontal scrollbar value is the scene-x of the visible left edge; map |
| 1265 | // it back to display-ns under the current viewport (origin pinned at scene x=0). |
| 1266 | if (view_ == nullptr || view_->horizontalScrollBar() == nullptr) { |
| 1267 | return 0; |
| 1268 | } |
| 1269 | return TimelineScene::pxToNs(static_cast<double>(view_->horizontalScrollBar()->value()), viewport_); |
| 1270 | } |
| 1271 | |
| 1272 | void Timeline::setViewportLeftDisplayNs(qint64 display_ns) { |
| 1273 | if (view_ == nullptr || view_->horizontalScrollBar() == nullptr) { |