Skip to content

Commit

Permalink
Merge pull request #1186 from ivandi69/diag_limits_button_fix
Browse files Browse the repository at this point in the history
Fix 'Set Diagram Limits' not updating the diagram
  • Loading branch information
ra3xdh authored Jan 5, 2025
2 parents 3dd56e6 + a40ad6d commit f8cf328
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions qucs/mouseactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1886,10 +1886,7 @@ void MouseActions::MReleaseSetLimits(Schematic *Doc, QMouseEvent *Event)

diagram->setLimitsBySelectionRect(select);

// TODO: Consider refactoring loadGraphData to reload the current dataset if an empty string is passed.
QFileInfo Info(Doc->getDocName());
QString defaultDataSet = Info.absolutePath() + QDir::separator() + Doc->getDataSet();
diagram->loadGraphData(defaultDataSet);
diagram->updateGraphData();

Doc->setChanged(true, true);

Expand Down
9 changes: 3 additions & 6 deletions qucs/qucs_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,14 @@ void QucsApp::slotResetDiagramLimits()
{
if (view->focusElement && view->focusElement->Type == isDiagram)
{
Diagram* diagram = (Diagram*)(view->focusElement);
Diagram* diagram = dynamic_cast<Diagram*>(view->focusElement);
Schematic* Doc = dynamic_cast<Schematic*>(DocumentTab->currentWidget());

diagram->xAxis.autoScale = true;
diagram->yAxis.autoScale = true;
diagram->zAxis.autoScale = true;

// Now read in the data.
auto* Doc = (Schematic*)DocumentTab->currentWidget();
QFileInfo Info(Doc->getDocName());
QString defaultDataSet = Info.absolutePath() + QDir::separator() + Doc->getDataSet();
diagram->loadGraphData(defaultDataSet);
diagram->updateGraphData();

Doc->setChanged(true, true);
Doc->viewport()->update();
Expand Down

0 comments on commit f8cf328

Please sign in to comment.