Better baseline adjustment

The way we were adjusting baselines if min-height forces
a size increase was not quite working as intended. Redo
it in a simpler way: just split up the excess and count
half of it for above the baseline and half below.

This fixes button labels in dialogs appearing too low.
This commit is contained in:
Matthias Clasen 2016-02-25 16:36:13 -05:00
parent a975e733dc
commit 09b1571093

View File

@ -577,14 +577,12 @@ gtk_css_gadget_get_preferred_size (GtkCssGadget *gadget,
if (minimum_baseline && *minimum_baseline > -1)
{
if (*minimum > 0)
*minimum_baseline = *minimum_baseline * forced_minimum / *minimum;
*minimum_baseline += 0.5 * (forced_minimum - *minimum);
*minimum_baseline = MAX (0, *minimum_baseline + extra_baseline);
}
if (natural_baseline && *natural_baseline > -1)
{
if (*natural > 0)
*natural_baseline = *natural_baseline * forced_natural / *natural;
*natural_baseline += 0.5 * (forced_natural - *natural);
*natural_baseline = MAX (0, *natural_baseline + extra_baseline);
}