X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftint2;a=blobdiff_plain;f=src%2Futil%2Farea.c;h=9b70b1210f54d44c8e43fe3d739ce4b5f91707ee;hp=f98e1613e06088954fdbbd52e1618d80c759366a;hb=2fe8ce00afa75977d3fd394481b19deaf3d102a5;hpb=b1cdb484a3b06d20e0b9b14ae0c98721ad3fead0 diff --git a/src/util/area.c b/src/util/area.c index f98e161..9b70b12 100644 --- a/src/util/area.c +++ b/src/util/area.c @@ -221,7 +221,7 @@ void refresh (Area *a) } -int resize_by_layout(void *obj) +int resize_by_layout(void *obj, int maximum_size) { Area *child, *a = (Area*)obj; int size, nb_by_content=0, nb_by_layout=0; @@ -247,6 +247,10 @@ int resize_by_layout(void *obj) if (nb_by_layout) { width = size / nb_by_layout; modulo = size % nb_by_layout; + if (width > maximum_size && maximum_size != 0) { + width = maximum_size; + modulo = 0; + } } // resize SIZE_BY_LAYOUT objects @@ -284,6 +288,10 @@ int resize_by_layout(void *obj) if (nb_by_layout) { height = size / nb_by_layout; modulo = size % nb_by_layout; + if (height > maximum_size && maximum_size != 0) { + height = maximum_size; + modulo = 0; + } } // resize SIZE_BY_LAYOUT objects