diff --git a/src/gui_builder.cc b/src/gui_builder.cc index 7a452d1..d4336de 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -94,7 +94,7 @@ GuiBuilder::on_view_show_threads_activate() { _show_threads = !_show_threads; _simulation_widget->set_show_threads(_show_threads); - _simulation_widget->redraw(); + _simulation_widget->resize_redraw(); _holt_container.get_holt_widget().set_show_threads(_show_threads); _holt_container.get_holt_widget().update(Simulation::get_instance()); } diff --git a/src/holt_widget.cc b/src/holt_widget.cc index 6a3edc8..bac6d89 100644 --- a/src/holt_widget.cc +++ b/src/holt_widget.cc @@ -499,8 +499,8 @@ HoltWidget::update(const Simulation& changed_simulation) std::cout << "HoltWidget::update - Simulation" << endl; // Force redraw //redraw(); - acquire(); - resize_redraw(); + // acquire(); + // resize_redraw(); } @@ -510,8 +510,8 @@ HoltWidget::update(const History& changed_history) std::cout << "HoltWidget::update - History" << endl; // Force redraw //redraw(); - //acquire(); - //resize_redraw(); + acquire(); + resize_redraw(); } diff --git a/src/simulation_widget.cc b/src/simulation_widget.cc index 8f700ca..6a3bcb3 100644 --- a/src/simulation_widget.cc +++ b/src/simulation_widget.cc @@ -125,7 +125,8 @@ SimulationWidget::update(const History& /* changed_history */ ) // Force redraw _last_drawn = 0; _partial_redraw = false; - count_elements(); + // MOVED in calc_drawing_size(...) + // count_elements(); resize_redraw(); } @@ -439,6 +440,8 @@ SimulationWidget::calc_drawing_size(cairo_t* ctx, size_t& width, size_t& height) { if(!_simulation) return; + + count_elements(); const History& hist = _simulation->get_history(); // const Environment::Processes& processes = hist.get_last_environment().get_processes(); int pos = _simulation->get_history().get_front();