diff --git a/viewer/JFJochViewerDatasetInfo.cpp b/viewer/JFJochViewerDatasetInfo.cpp index 985c3f6f..aa0a535c 100644 --- a/viewer/JFJochViewerDatasetInfo.cpp +++ b/viewer/JFJochViewerDatasetInfo.cpp @@ -251,8 +251,15 @@ void JFJochViewerDatasetInfo::UpdatePlot() { RunColor(static_cast(runs_.size())), XForRun(*live_run_)}); } + // The whole dataset spans this many images (the largest run, i.e. the original file), so the + // x-axis is fixed to it and subset runs appear at their real position. + int64_t full_range = dataset->experiment.GetImageNum(); + for (const auto &run: runs_) + if (run.dataset) + full_range = std::max(full_range, run.dataset->experiment.GetImageNum()); + chart_view->loadValues(data, image_number, one_over_d2, dataset.get(), primary_name, - std::move(overlays), primary_color, XForRun(*dataset)); + std::move(overlays), primary_color, XForRun(*dataset), full_range); if (dataset->experiment.GetGridScan()) { stack->setCurrentWidget(grid_scan_image); diff --git a/viewer/charts/JFJochDatasetInfoChartView.cpp b/viewer/charts/JFJochDatasetInfoChartView.cpp index 25e65dde..77806db2 100644 --- a/viewer/charts/JFJochDatasetInfoChartView.cpp +++ b/viewer/charts/JFJochDatasetInfoChartView.cpp @@ -132,11 +132,12 @@ void JFJochDatasetInfoChartView::resetZoom() { void JFJochDatasetInfoChartView::loadValues(const std::vector &input, int64_t image, bool one_over_d2, const JFJochReaderDataset *dataset, const QString &primaryName, std::vector overlays, const QColor &primaryColor, - std::vector primaryX) { + std::vector primaryX, int64_t fullRange) { m_yOneOverD = one_over_d2; primaryName_ = primaryName; primary_color_ = primaryColor; primary_x_ = std::move(primaryX); + full_range_ = fullRange; // d -> 1/d^2 for resolution plots; identity otherwise. Applied to every series alike. auto transform = [one_over_d2](const std::vector &in, std::vector &out) { @@ -301,6 +302,9 @@ void JFJochDatasetInfoChartView::buildTimeDomainChart() { // ----- X axis handling ----- QValueAxis *axisX = qobject_cast(chart()->axisX(series)); if (axisX) { + // Always span the whole dataset so a subset run shows at its real position, not stretched. + if (full_range_ > 1) + axisX->setRange(0, static_cast(full_range_ - 1)); if (goniometer_axis.has_value() && m_xUseGoniometerAxis) { // Hide labels on numeric axis and move it to the top diff --git a/viewer/charts/JFJochDatasetInfoChartView.h b/viewer/charts/JFJochDatasetInfoChartView.h index ce3f6bca..98352e66 100644 --- a/viewer/charts/JFJochDatasetInfoChartView.h +++ b/viewer/charts/JFJochDatasetInfoChartView.h @@ -54,6 +54,7 @@ private: std::vector overlays_; QColor primary_color_; // colour of the active (primary) run, if assigned std::vector primary_x_; // x (image numbers) for the primary series; empty => index + int64_t full_range_ = 0; // total images in the dataset; fixes the x-axis to [0, n) // Append (binned) finite points of vals to s at x positions (xs empty => index), extending [mn,mx]. void appendSeries(QLineSeries *s, const std::vector &vals, const std::vector &xs, double &mn, double &mx) const; @@ -99,7 +100,8 @@ public: const QString &primaryName = QString(), std::vector overlays = {}, const QColor &primaryColor = QColor(), - std::vector primaryX = {}); + std::vector primaryX = {}, + int64_t fullRange = 0); }; diff --git a/viewer/jfjoch_viewer.cpp b/viewer/jfjoch_viewer.cpp index 863a3e48..6b2cb111 100644 --- a/viewer/jfjoch_viewer.cpp +++ b/viewer/jfjoch_viewer.cpp @@ -29,6 +29,9 @@ int main(int argc, char *argv[]) { pal.setColor(QPalette::Highlight, QColor(0x2a, 0x9d, 0x8f)); pal.setColor(QPalette::HighlightedText, Qt::white); app.setPalette(pal); + // Fusion fills QGroupBox interiors with a flat light colour; make them transparent so they show + // the salmon window background like the rest of the UI (entry widgets stay white via the palette). + app.setStyleSheet("QGroupBox { background-color: transparent; }"); QIcon appIcon(":/jfjoch.png"); app.setWindowIcon(appIcon);