Partly revert 4ba26659
, it was just wrong.
This commit is contained in:
parent
29d64bd04e
commit
5287dce9cc
10
src/layout.c
10
src/layout.c
|
@ -460,7 +460,7 @@ void render_container(xcb_connection_t *conn, Container *container) {
|
||||||
if (container->stack_limit == STACK_LIMIT_COLS) {
|
if (container->stack_limit == STACK_LIMIT_COLS) {
|
||||||
/* wrap stores the number of rows after which we will
|
/* wrap stores the number of rows after which we will
|
||||||
* wrap to a new column. */
|
* wrap to a new column. */
|
||||||
wrap = container->stack_limit_value;
|
wrap = ceil((float)num_clients / container->stack_limit_value);
|
||||||
} else if (container->stack_limit == STACK_LIMIT_ROWS) {
|
} else if (container->stack_limit == STACK_LIMIT_ROWS) {
|
||||||
/* When limiting rows, the wrap variable serves a
|
/* When limiting rows, the wrap variable serves a
|
||||||
* slightly different purpose: it holds the number of
|
* slightly different purpose: it holds the number of
|
||||||
|
@ -497,10 +497,10 @@ void render_container(xcb_connection_t *conn, Container *container) {
|
||||||
if (container->stack_limit == STACK_LIMIT_COLS) {
|
if (container->stack_limit == STACK_LIMIT_COLS) {
|
||||||
offset_x = current_col * (stack_win->rect.width / container->stack_limit_value);
|
offset_x = current_col * (stack_win->rect.width / container->stack_limit_value);
|
||||||
offset_y = current_row * decoration_height;
|
offset_y = current_row * decoration_height;
|
||||||
current_col++;
|
current_row++;
|
||||||
if ((current_col % wrap) == 0) {
|
if ((current_row % wrap) == 0) {
|
||||||
current_row++;
|
current_col++;
|
||||||
current_col = 0;
|
current_row = 0;
|
||||||
}
|
}
|
||||||
} else if (container->stack_limit == STACK_LIMIT_ROWS) {
|
} else if (container->stack_limit == STACK_LIMIT_ROWS) {
|
||||||
offset_x = current_col * wrap;
|
offset_x = current_col * wrap;
|
||||||
|
|
Loading…
Reference in New Issue