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

Method onPlotZoomChanged

pj_app/src/MainWindow.cpp:2155–2177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2153}
2154
2155void MainWindow::onPlotZoomChanged(PlotWidget* modified, QRectF rect) {
2156 if (!button_link_->isChecked()) {
2157 return;
2158 }
2159 if (modified == nullptr || modified->isEmpty() || modified->isXYPlot() || !modified->isZoomLinkEnabled()) {
2160 return;
2161 }
2162
2163 forEachPlot([modified, rect](PlotWidget* plot) {
2164 if (plot == modified || plot->isEmpty() || plot->isXYPlot() || !plot->isZoomLinkEnabled()) {
2165 return;
2166 }
2167 // Linked zoom only ever aligns the horizontal (time) range: copy the source's
2168 // X extent onto each peer while leaving its vertical range exactly as the user
2169 // left it. A purely-vertical gesture (wheel on the left axis, "Zoom Out
2170 // Vertically") therefore carries an unchanged X and resolves to a no-op here.
2171 QRectF peer_rect = plot->currentBoundingRect();
2172 peer_rect.setLeft(rect.left());
2173 peer_rect.setRight(rect.right());
2174 plot->setZoomRectangle(peer_rect, false);
2175 plot->replot();
2176 });
2177}
2178
2179void MainWindow::onTrackerMovedFromWidget(QPointF point) {
2180 session_->playbackEngine().setCurrentTime(displaySeconds(point.x()));

Callers

nothing calls this directly

Calls 7

isXYPlotMethod · 0.80
isZoomLinkEnabledMethod · 0.80
currentBoundingRectMethod · 0.80
setZoomRectangleMethod · 0.80
isCheckedMethod · 0.45
isEmptyMethod · 0.45
replotMethod · 0.45

Tested by

no test coverage detected