Commit 9c3907da authored by Matthias Clasen's avatar Matthias Clasen
Browse files

box gadget: Deal with optional arguments

The baseline arguments to the preferred size callback can
be NULL. Don't crash if they are.
parent 44d94a4a
......@@ -238,8 +238,10 @@ gtk_box_gadget_measure_opposite (GtkCssGadget *gadget,
total_min = MAX (total_min, above_min + below_min);
total_nat = MAX (total_nat, above_nat + below_nat);
/* assume GTK_BASELINE_POSITION_CENTER for now */
*minimum_baseline = above_min + (total_min - (above_min + below_min)) / 2;
*natural_baseline = above_nat + (total_nat - (above_nat + below_nat)) / 2;
if (minimum_baseline)
*minimum_baseline = above_min + (total_min - (above_min + below_min)) / 2;
if (natural_baseline)
*natural_baseline = above_nat + (total_nat - (above_nat + below_nat)) / 2;
}
*minimum = total_min;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment