Skip to content

Commit

Permalink
fix bug in scatter plot not allowing larger than 1 marker size
Browse files Browse the repository at this point in the history
  • Loading branch information
aglowacki committed Jun 6, 2024
1 parent d8c9973 commit 5903a26
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/mvc/ScatterPlotView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ ScatterPlotView::ScatterPlotView(bool display_log10, bool black_background, QWid

setBlackBackground(Preferences::inst()->getValue(STR_PFR_SCATTER_DARK_BACKGROUND).toBool());
_scatter_series->setBorderColor(Qt::transparent);
_scatter_series->setMarkerSize(1.0);
int val = Preferences::inst()->getValue(STR_PRF_ScatterPlot_Size).toInt();
if (val < 1)
{
val = 1;
}
_scatter_series->setMarkerSize(val);
//_scatter_series->setUseOpenGL(true); // causes exception when deconstructor called.
_chart->addSeries(_scatter_series);
_display_log10 = display_log10;
Expand Down
9 changes: 7 additions & 2 deletions src/mvc/ScatterPlotWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ void ScatterPlotWidget::_createLayout()
_sp_maker_size->setPrefix("Marker Size:");
_sp_maker_size->setRange(1, 100);
_sp_maker_size->setSingleStep(1.0);
_sp_maker_size->setValue(1);
int val = Preferences::inst()->getValue(STR_PRF_ScatterPlot_Size).toInt();
if (val < 1)
{
val = 1;
}
_sp_maker_size->setValue(val);
connect(_sp_maker_size, qOverload<int>(&QSpinBox::valueChanged), this, &ScatterPlotWidget::updateMarkerSize);


Expand Down Expand Up @@ -196,7 +201,7 @@ void ScatterPlotWidget::setBlackBackground(int val)

void ScatterPlotWidget::updateMarkerSize(int val)
{
val = std::min(val, 1);
val = std::max(val, 1);
for (auto& itr : _plot_view_list)
{
itr->updateMarkerSize(val);
Expand Down

0 comments on commit 5903a26

Please sign in to comment.