summaryrefslogtreecommitdiff
path: root/gtk/gtkconstraintsolver.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-06-28 16:59:39 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-06-28 16:59:39 +0000
commit463dffe48dab86facb26c3e800140876688b3bfd (patch)
tree4e73661a2d33fee378c4ef76c4ab27aa81cc53c6 /gtk/gtkconstraintsolver.c
parentd42c26b117a3757e757ace31da1d0553a60aa5e2 (diff)
downloadgtk+-repeat-edit.tar.gz
constraint solver: Fix repeat suggestionsrepeat-edit
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.
Diffstat (limited to 'gtk/gtkconstraintsolver.c')
-rw-r--r--gtk/gtkconstraintsolver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkconstraintsolver.c b/gtk/gtkconstraintsolver.c
index 22fa0111a4..a642d6b7af 100644
--- a/gtk/gtkconstraintsolver.c
+++ b/gtk/gtkconstraintsolver.c
@@ -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 >