box gadget: Don't allow shifting too far

We don't want to let baseline adjustment shift the child
out of the original allocation. This is purely a sanity
measure - in practice, the baseline should always be bigger
than the child_baseline.
This commit is contained in:
Matthias Clasen 2016-01-22 22:49:01 -05:00
parent 50e923349e
commit 73307f78dc

View File

@ -314,7 +314,7 @@ gtk_box_gadget_allocate_child (GObject *child,
if (minimum_baseline >= 0 && baseline >= 0)
{
child_allocation.height = MIN(natural, allocation->height);
child_allocation.y = allocation->y + baseline - minimum_baseline;
child_allocation.y = allocation->y + MAX(0, baseline - minimum_baseline);
break;
}
case GTK_ALIGN_CENTER: