Skip to content

Commit f87779e

Browse files
committed
add d_rescaler->rescale(); to fix loading raw wavefronts
1 parent 3c53c26 commit f87779e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

contourplot.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,16 @@ void ContourPlot::setSurface(wavefront * wf) {
471471

472472
setFooter(name + QString(" %1 rms %2 X %3").arg(wf->std, 6, 'f', 3).arg(wf->data.cols).arg(wf->data.rows));
473473

474-
plotLayout()->setAlignCanvasToScales(true);
475-
476474
// Update rescaler reference interval to match data dimensions
477475
d_rescaler->setIntervalHint(QwtPlot::xBottom, QwtInterval(0, wf->data.cols));
478476
d_rescaler->setIntervalHint(QwtPlot::yLeft, QwtInterval(0, wf->data.rows));
477+
// Force an immediate rescale
478+
d_rescaler->rescale();
479+
480+
// Set canvas alignment after rescale
481+
plotLayout()->setAlignCanvasToScales(true);
482+
483+
spdlog::get("logger")->trace("ContourPlot::setSurface {}x{}", wf->data.cols, wf->data.rows);
479484

480485
showContoursChanged(contourRange);
481486
tracker_->setZoomBase(true);
@@ -491,6 +496,7 @@ double ContourPlot::m_zOffset = 0.;
491496
ContourPlot::ContourPlot( QWidget *parent, ContourTools *tools, bool minimal ):
492497
QwtPlot( parent ),m_wf(0),m_tools(tools), m_autoInterval(false),m_minimal(minimal), m_linkProfile(true),m_contourPen(Qt::white)
493498
{
499+
spdlog::get("logger")->trace("ContourPlot::ContourPlot");
494500
d_spectrogram = new QwtPlotSpectrogram();
495501
picker_ = new QwtPlotPicker(this->canvas());
496502
picker_->setStateMachine(new QwtPickerClickPointMachine);

0 commit comments

Comments
 (0)