Skip to content

Commit

Permalink
fix: fixed bug related to XY plot variable selection
Browse files Browse the repository at this point in the history
  • Loading branch information
klonyyy committed Dec 8, 2024
1 parent fa17bda commit b7acf27
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Gui/GuiPlotEdit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ class PlotEditWindow
{
GuiHelper::drawTextAlignedToSize("X-axis variable:", alignment);
ImGui::SameLine();
std::string selectedVariable = selection.empty() ? editedPlot->getXAxisVariable()->getName() : *selection.begin();

std::string selectedVariable = "";

if (selection.empty())
selectedVariable = editedPlot->getXAxisVariable() ? editedPlot->getXAxisVariable()->getName() : "";
else
selectedVariable = *selection.begin();

ImGui::InputText("##", &selectedVariable, 0, NULL, NULL);
if (variableHandler->contains(selectedVariable))
editedPlot->setXAxisVariable(variableHandler->getVariable(selectedVariable).get());
Expand Down

0 comments on commit b7acf27

Please sign in to comment.