cassowary.js
cassowary.js copied to clipboard
Mutable constant, Strength&weight in Constraint.
Currently, the only way to change the strength or constant in a Constraint is to replace a constraint with a new one with new values.
In a constraint-based UI, the only way to change the size or position of an element is to change the constant of the constraint managing the layout. This is why changing a constant should be simple and efficient.
FYI, set_constant is implemented in a branch of rhea : https://github.com/Nocte-/rhea/blob/0.3/rhea/simplex_solver.cpp#L188
I like this a lot better than the add/remove churn. We should do this.