diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2019-04-09 15:33:52 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2019-06-30 23:42:44 +0100 |
commit | cdf80f1d652114a6bb7c9a3d38adec61f8dbcabb (patch) | |
tree | c1cd3872541d8c1e27bc2e6cb5dd28b24697ae7d /gtk/gtkconstraintsolver.c | |
parent | e7b2c530c512523242270caaaa8e0a15bf99e492 (diff) | |
download | gtk+-cdf80f1d652114a6bb7c9a3d38adec61f8dbcabb.tar.gz |
Add GtkConstraintLayout
A layout manager using GtkConstraintSolver to measure and allocate
children.
Diffstat (limited to 'gtk/gtkconstraintsolver.c')
-rw-r--r-- | gtk/gtkconstraintsolver.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/gtk/gtkconstraintsolver.c b/gtk/gtkconstraintsolver.c index 411b006957..53262b70af 100644 --- a/gtk/gtkconstraintsolver.c +++ b/gtk/gtkconstraintsolver.c @@ -348,37 +348,6 @@ gtk_constraint_solver_init (GtkConstraintSolver *self) self->auto_solve = TRUE; } -/* Symbolic weight thresholds - * - * Constraint weights live on a continuum, but we use thresholds for simplicity's - * sake, so we don't have to necessarily reason in terms of numeric values. - * - * The public API has a similar approach, where the symbolic constants are negative - * values, and positive values are explicit weights. We map those values into - * numeric values that the GtkConstraintSolver can plug into the linear equations - * tableau. - */ -#define GTK_CONSTRAINT_WEIGHT_REQUIRED (make_weight (1000, 1000, 1000, 1)) -#define GTK_CONSTRAINT_WEIGHT_STRONG (make_weight ( 1, 0, 0, 1)) -#define GTK_CONSTRAINT_WEIGHT_MEDIUM (make_weight ( 0, 1, 0, 1)) -#define GTK_CONSTRAINT_WEIGHT_WEAK (make_weight ( 0, 0, 1, 1)) - -G_GNUC_PURE -static inline double -make_weight (double a, - double b, - double c, - double w) -{ - double res = 0; - - res += CLAMP (a * w, 0, 1000) * 1000000; - res += CLAMP (b * w, 0, 1000) * 1000; - res += CLAMP (c * w, 0, 1000); - - return res; -} - static void gtk_constraint_ref_free (GtkConstraintRef *self) { |