forked from StudioInfinity/dyna3
Name constraint Lorentz product more descriptively
This commit is contained in:
parent
a4ec52a4e7
commit
5839882ed7
3 changed files with 17 additions and 17 deletions
|
@ -214,13 +214,13 @@ pub fn AddRemove() -> View {
|
|||
(subject_vec[0].clone(), subject_vec[1].clone())
|
||||
}
|
||||
);
|
||||
let rep = create_signal(0.0);
|
||||
let lorentz_prod = create_signal(0.0);
|
||||
let active = create_signal(true);
|
||||
state.assembly.insert_constraint(Constraint {
|
||||
subjects: subjects,
|
||||
rep: rep,
|
||||
rep_text: create_signal(String::new()),
|
||||
rep_valid: create_signal(false),
|
||||
lorentz_prod: lorentz_prod,
|
||||
lorentz_prod_text: create_signal(String::new()),
|
||||
lorentz_prod_valid: create_signal(false),
|
||||
active: active,
|
||||
});
|
||||
state.assembly.realize();
|
||||
|
@ -236,7 +236,7 @@ pub fn AddRemove() -> View {
|
|||
&JsValue::from(cst.subjects.0),
|
||||
&JsValue::from(cst.subjects.1),
|
||||
&JsValue::from(":"),
|
||||
&JsValue::from(cst.rep.get_untracked())
|
||||
&JsValue::from(cst.lorentz_prod.get_untracked())
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -244,10 +244,10 @@ pub fn AddRemove() -> View {
|
|||
// update the realization when the constraint activated, or
|
||||
// edited while active
|
||||
create_effect(move || {
|
||||
rep.track();
|
||||
lorentz_prod.track();
|
||||
console::log_2(
|
||||
&JsValue::from("Lorentz product updated to"),
|
||||
&JsValue::from(rep.get_untracked())
|
||||
&JsValue::from(lorentz_prod.get_untracked())
|
||||
);
|
||||
if active.get() {
|
||||
state.assembly.realize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue