dwm.c
changeset 1466 aa47da304ae2
parent 1464 555070221577
child 1468 654a2e8064ae
equal deleted inserted replaced
1464:555070221577 1466:aa47da304ae2
   348 			*h -= c->baseh;
   348 			*h -= c->baseh;
   349 		}
   349 		}
   350 		/* adjust for aspect limits */
   350 		/* adjust for aspect limits */
   351 		if(c->mina > 0 && c->maxa > 0) {
   351 		if(c->mina > 0 && c->maxa > 0) {
   352 			if(c->maxa < (float)*w / *h)
   352 			if(c->maxa < (float)*w / *h)
   353 				*w = *h * c->maxa;
   353 				*w = *h * c->maxa + 0.5; /* -Os double upcast workaround */
   354 			else if(c->mina < (float)*h / *w)
   354 			else if(c->mina < (float)*h / *w)
   355 				*h = *w * c->mina;
   355 				*h = *w * c->mina + 0.5; /* -Os double upcast workaround */
   356 		}
   356 		}
   357 		if(baseismin) { /* increment calculation requires this */
   357 		if(baseismin) { /* increment calculation requires this */
   358 			*w -= c->basew;
   358 			*w -= c->basew;
   359 			*h -= c->baseh;
   359 			*h -= c->baseh;
   360 		}
   360 		}
  1805 		c->minh = size.base_height;
  1805 		c->minh = size.base_height;
  1806 	}
  1806 	}
  1807 	else
  1807 	else
  1808 		c->minw = c->minh = 0;
  1808 		c->minw = c->minh = 0;
  1809 	if(size.flags & PAspect) {
  1809 	if(size.flags & PAspect) {
  1810 		c->mina = (float)size.min_aspect.y / (float)size.min_aspect.x;
  1810 		c->mina = (float)size.min_aspect.y / size.min_aspect.x;
  1811 		c->maxa = (float)size.max_aspect.x / (float)size.max_aspect.y;
  1811 		c->maxa = (float)size.max_aspect.x / size.max_aspect.y;
  1812 	}
  1812 	}
  1813 	else
  1813 	else
  1814 		c->maxa = c->mina = 0.0;
  1814 		c->maxa = c->mina = 0.0;
  1815 	c->isfixed = (c->maxw && c->minw && c->maxh && c->minh
  1815 	c->isfixed = (c->maxw && c->minw && c->maxh && c->minh
  1816 	             && c->maxw == c->minw && c->maxh == c->minh);
  1816 	             && c->maxw == c->minw && c->maxh == c->minh);