mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
grid: avoid a floating point exception
When a homogeneous grid has no visible children, we were accidentally doing a division by zero. Instead, just bail out early in this case, there is nothing to allocate anyway. https://bugzilla.gnome.org/show_bug.cgi?id=672763
This commit is contained in:
parent
cc6db27ff4
commit
ed17c74f58
@ -1020,6 +1020,9 @@ gtk_grid_request_allocate (GtkGridRequest *request,
|
||||
|
||||
gtk_grid_request_compute_expand (request, orientation, &nonempty, &expand);
|
||||
|
||||
if (nonempty == 0)
|
||||
return;
|
||||
|
||||
linedata = &priv->linedata[orientation];
|
||||
lines = &request->lines[orientation];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user