w->draw = func;
w->center.y = 0;
w->center.x = 0;
- if (0 < width)
+ w->framesize.y = world.wmeta.padsize.y - 1;
+ if (0 < height && height <= world.wmeta.padsize.y - 1)
{
- w->framesize.x = width;
+ w->framesize.y = height;
}
- else if (0 >= width)
+ else if (0 > height && world.wmeta.padsize.y + (height - 1) > 0)
{
- w->framesize.x = world.wmeta.padsize.x + width;
+ w->framesize.y = world.wmeta.padsize.y + (height - 1);
}
- if (0 < height && height <= world.wmeta.padsize.y - 1)
+ w->framesize.x = world.wmeta.padsize.x;
+ if (0 < width)
{
- w->framesize.y = height;
+ w->framesize.x = width;
}
- else if (0 >= height && world.wmeta.padsize.y + (height - 1) > 0)
+ else if (0 > width && world.wmeta.padsize.x + width > 0)
{
- w->framesize.y = world.wmeta.padsize.y + (height - 1);
+ w->framesize.x = world.wmeta.padsize.x + width;
}
*wp = w;
}
* Pass 0 for "width" to make the window as wide as the terminal screen. Pass 0
* for "height" for the maximum allowed height: one cell smaller than that of
* the terminal screen. Pass negative values for either of them to make the
- * window width/height so many cells smaller than what 0 would set. The maximum
- * allowed height is also applied for positive height values that exceed it or
- * negative values that would reduce the window height to less than 1 cell.
+ * window width/height so many cells smaller than what 0 would set. Values that
+ * that would reduce the window height or width to less than 1 cell according to
+ * the aforementioned rules set the height/width as if they were set to 0.
*/
extern void init_win(struct Win ** wp, char * title, int16_t height,
int16_t width, void * func);