slightlyoff / cassowary.js

Cassowary/JS, better, faster, future-ready
Other
1.69k stars 107 forks source link

Mutable constant, Strength&weight in Constraint. #66

Open cacaodev opened 9 years ago

cacaodev commented 9 years ago

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

slightlyoff commented 9 years ago

I like this a lot better than the add/remove churn. We should do this.