Nudge from initial step of failed realization

This commit is contained in:
Aaron Fenyes 2025-08-28 09:42:56 +02:00
parent 36036141b5
commit 43a65eba65

View file

@ -597,16 +597,16 @@ pub fn Display() -> View {
|status| status.is_ok() |status| status.is_ok()
); );
let step_val = state.assembly.step.with_untracked(|step| step.value); let step_val = state.assembly.step.with_untracked(|step| step.value);
let on_init_step = step_val.is_some_and(|n| n == 0.0);
let on_last_step = step_val.is_some_and( let on_last_step = step_val.is_some_and(
|n| state.assembly.descent_history.with_untracked( |n| state.assembly.descent_history.with_untracked(
|history| n as usize + 1 == history.config.len().max(1) |history| n as usize + 1 == history.config.len().max(1)
) )
); );
if let on_manipulable_step =
state.selection.with(|sel| sel.len() == 1) !realization_successful && on_init_step
&& realization_successful || realization_successful && on_last_step;
&& on_last_step if on_manipulable_step && state.selection.with(|sel| sel.len() == 1) {
{
let sel = state.selection.with( let sel = state.selection.with(
|sel| sel.into_iter().next().unwrap().clone() |sel| sel.into_iter().next().unwrap().clone()
); );