/* adjust the height to match the width for the aspect ratios.
for this, min size is not substituted for base size ever. */
- *w -= self->base_size.width;
- *h -= self->base_size.height;
+ if (self->base_size.width >= 0 && self->base_size.height >= 0) {
+ *w -= self->base_size.width;
+ *h -= self->base_size.height;
+ }
if (minratio)
if (*h * minratio > *w) {
}
}
- *w += self->base_size.width;
- *h += self->base_size.height;
+ if (self->base_size.width >= 0 && self->base_size.height >= 0) {
+ *w += self->base_size.width;
+ *h += self->base_size.height;
+ }
}
/* these override the above states! if you cant move you can't move! */