sizerequest: Simplify some code

Avoid some repeated MAX().
This commit is contained in:
Matthias Clasen 2021-07-24 18:44:33 -04:00
parent 0d8dd0c664
commit d76460343a

View File

@ -234,13 +234,16 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
&minimum_for_size, &natural_for_size,
NULL, NULL);
if (for_size < MAX (minimum_for_size, css_min_for_size))
for_size = MAX (minimum_for_size, css_min_for_size);
if (minimum_for_size < css_min_for_size)
minimum_for_size = css_min_for_size;
if (for_size < minimum_for_size)
for_size = minimum_for_size;
adjusted_for_size = for_size - widget_margins_for_size;
adjusted_for_size -= css_extra_for_size;
if (adjusted_for_size < 0)
adjusted_for_size = MAX (minimum_for_size, css_min_for_size);
adjusted_for_size = minimum_for_size;
push_recursion_check (widget, orientation);
gtk_layout_manager_measure (layout_manager, widget,
@ -272,13 +275,16 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
gtk_widget_measure (widget, OPPOSITE_ORIENTATION (orientation), -1,
&minimum_for_size, &natural_for_size, NULL, NULL);
if (for_size < MAX (minimum_for_size, css_min_for_size))
for_size = MAX (minimum_for_size, css_min_for_size);
if (minimum_for_size < css_min_for_size)
minimum_for_size = css_min_for_size;
if (for_size < minimum_for_size)
for_size = minimum_for_size;
adjusted_for_size = for_size - widget_margins_for_size;
adjusted_for_size -= css_extra_for_size;
if (adjusted_for_size < 0)
adjusted_for_size = MAX (minimum_for_size, css_min_for_size);
adjusted_for_size = minimum_for_size;
push_recursion_check (widget, orientation);
widget_class->measure (widget,