Clean up the outline view #19
@ -187,15 +187,15 @@ pub fn AddRemove() -> View {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
let lorentz_prod = create_signal(0.0);
|
let lorentz_prod = create_signal(0.0);
|
||||||
|
let lorentz_prod_valid = create_signal(false);
|
||||||
let active = create_signal(true);
|
let active = create_signal(true);
|
||||||
state.assembly.insert_constraint(Constraint {
|
state.assembly.insert_constraint(Constraint {
|
||||||
subjects: subjects,
|
subjects: subjects,
|
||||||
lorentz_prod: lorentz_prod,
|
lorentz_prod: lorentz_prod,
|
||||||
lorentz_prod_text: create_signal(String::new()),
|
lorentz_prod_text: create_signal(String::new()),
|
||||||
lorentz_prod_valid: create_signal(false),
|
lorentz_prod_valid: lorentz_prod_valid,
|
||||||
active: active,
|
active: active,
|
||||||
});
|
});
|
||||||
state.assembly.realize();
|
|
||||||
state.selection.update(|sel| sel.clear());
|
state.selection.update(|sel| sel.clear());
|
||||||
|
|
||||||
/* DEBUG */
|
/* DEBUG */
|
||||||
@ -213,15 +213,14 @@ pub fn AddRemove() -> View {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// update the realization when the constraint is activated,
|
// update the realization when the constraint becomes active
|
||||||
// or edited while active
|
// and valid, or is edited while active and valid
|
||||||
create_effect(move || {
|
create_effect(move || {
|
||||||
|
console::log_1(&JsValue::from(
|
||||||
|
format!("Constraint ({}, {}) updated", subjects.0, subjects.1)
|
||||||
|
));
|
||||||
lorentz_prod.track();
|
lorentz_prod.track();
|
||||||
console::log_2(
|
if active.get() && lorentz_prod_valid.get() {
|
||||||
&JsValue::from("Lorentz product updated to"),
|
|
||||||
&JsValue::from(lorentz_prod.get_untracked())
|
|
||||||
);
|
|
||||||
if active.get() {
|
|
||||||
state.assembly.realize();
|
state.assembly.realize();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user