constraint solver: Fix repeat suggestions
We were not storing the previous value, causing the first two suggestions to work, but not later ones. Fixes the test added in the previous commit.
This commit is contained in:
@@ -1972,6 +1972,7 @@ gtk_constraint_solver_suggest_value (GtkConstraintSolver *self,
|
||||
double value)
|
||||
{
|
||||
EditInfo *ei = g_hash_table_lookup (self->edit_var_map, variable);
|
||||
double delta;
|
||||
if (ei == NULL)
|
||||
{
|
||||
g_critical ("Suggesting value '%g' but variable %p is not editable",
|
||||
@@ -1987,9 +1988,10 @@ gtk_constraint_solver_suggest_value (GtkConstraintSolver *self,
|
||||
return;
|
||||
}
|
||||
|
||||
ei->prev_constant = value - ei->prev_constant;
|
||||
delta = value - ei->prev_constant;
|
||||
ei->prev_constant = value;
|
||||
|
||||
gtk_constraint_solver_delta_edit_constant (self, ei->prev_constant, ei->eplus, ei->eminus);
|
||||
gtk_constraint_solver_delta_edit_constant (self, delta, ei->eplus, ei->eminus);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
|
||||
Reference in New Issue
Block a user