diff options
author | oga | 2009-08-25 01:32:40 +0000 |
---|---|---|
committer | oga | 2009-08-25 01:32:40 +0000 |
commit | 71f8651be40544b3509ecefb35bd644e3ec791af (patch) | |
tree | 32fa24b06de9367208b12dda3247172f5ed6f70c /client.c | |
parent | 09019000cbd1889f8be39a78289676b290321e65 (diff) | |
download | cwm-71f8651be40544b3509ecefb35bd644e3ec791af.tar.gz |
Instead of messing around everytime we do a resize, just clamp the
resize increments to a minimum of one, and use it unconditionally.
"you've convinced me, do it!" okan@
Diffstat (limited to '')
-rw-r--r-- | client.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: client.c,v 1.62 2009/08/25 01:26:09 okan Exp $ + * $Id: client.c,v 1.63 2009/08/25 01:32:40 oga Exp $ */ #include "headers.h" @@ -685,6 +685,9 @@ client_getsizehints(struct client_ctx *cc) cc->geom.incw = cc->size->width_inc; cc->geom.inch = cc->size->height_inc; } + cc->geom.incw = MAX(1, cc->geom.incw); + cc->geom.inch = MAX(1, cc->geom.inch); + if (cc->size->flags & PAspect) { if (cc->size->min_aspect.x > 0) cc->geom.mina = (float)cc->size->min_aspect.y / @@ -725,10 +728,8 @@ client_applysizehints(struct client_ctx *cc) } /* adjust for increment value */ - if (cc->geom.incw) - cc->geom.width -= cc->geom.width % cc->geom.incw; - if (cc->geom.inch) - cc->geom.height -= cc->geom.height % cc->geom.inch; + cc->geom.width -= cc->geom.width % cc->geom.incw; + cc->geom.height -= cc->geom.height % cc->geom.inch; /* restore base dimensions */ cc->geom.width += cc->geom.basew; |