Commit f9b544e5 authored by Yann Boucher's avatar Yann Boucher
Browse files

Fixed a bug that didn't allow negative and large values for coordinates, and...

Fixed a bug that didn't allow negative and large values for coordinates, and fixed a bug that reset the values when customizing a model
parent c9f6d2bd
Pipeline #78780 passed with stages
in 16 seconds
......@@ -314,9 +314,6 @@ void MainWindow::enable_rule_customization()
ui->simulation_tab->setEnabled(false);
ui->customize_button->setEnabled(false);
ui->rule_settings->setEnabled(true);
update_neighborhood_settings();
update_transition_settings();
}
void MainWindow::disable_rule_customization()
......@@ -356,8 +353,8 @@ void MainWindow::load_model(const QJsonObject &obj)
}
// On transfère la propriété de ces pointeurs vers Simulation, qui en est désormais propriétaire pour l'exécution de l'automate
simulation.setNeighborhoodRule(m_neighborhood_rule); m_neighborhood_rule = nullptr;
simulation.setTransitionRule(m_transition_rule); m_transition_rule = nullptr;
simulation.setNeighborhoodRule(m_neighborhood_rule);
simulation.setTransitionRule(m_transition_rule);
}
void MainWindow::save_model()
......
......@@ -119,6 +119,8 @@ void UIBuilderVisitor::visit(CoordinateProperty &prop)
frame->layout()->addItem(new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
add_widget(prop.display_name(), frame);
spin_x->setMinimum(std::numeric_limits<int>::min()); spin_y->setMinimum(std::numeric_limits<int>::min());
spin_x->setMaximum(std::numeric_limits<int>::max()); spin_y->setMaximum(std::numeric_limits<int>::max());
spin_x->setValue(prop.c.x); spin_y->setValue(prop.c.y);
QObject::connect(spin_x, QOverload<int>::of(&QSpinBox::valueChanged),
[&prop](int i) { prop.c.x = i; });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment