dwm.c
changeset 1165 3ac7eb240b52
parent 1163 f330c3a2dc76
child 1166 bf38679903b3
--- a/dwm.c	Mon Mar 31 10:09:48 2008 +0100
+++ b/dwm.c	Tue Apr 01 15:46:00 2008 +0100
@@ -1196,9 +1196,9 @@
 
 	if(sizehints) {
 		/* set minimum possible */
-		if (w < 1)
+		if(w < 1)
 			w = 1;
-		if (h < 1)
+		if(h < 1)
 			h = 1;
 
 		/* temporarily remove base dimensions */
@@ -1206,7 +1206,9 @@
 		h -= c->baseh;
 
 		/* adjust for aspect limits */
-		if (c->minay > 0 && c->maxay > 0 && c->minax > 0 && c->maxax > 0) {
+		if(c->minax != c->maxax && c->minay != c->maxay 
+		&& c->minax > 0 && c->maxax > 0 && c->minay > 0 && c->maxay > 0)
+		{
 			if (w * c->maxay > h * c->maxax)
 				w = h * c->maxax / c->maxay;
 			else if (w * c->minay < h * c->minax)