Bugfix: Obey colspan/rowspan when checking if containers can be snapped to the right/bottom (Thanks Mirko)
This fixes ticket #54.
This commit is contained in:
parent
325d1b301f
commit
93ff4159c1
|
@ -372,8 +372,9 @@ static void snap_current_container(xcb_connection_t *conn, direction_t direction
|
||||||
case D_RIGHT: {
|
case D_RIGHT: {
|
||||||
/* Check if the cell is used */
|
/* Check if the cell is used */
|
||||||
int new_col = container->col + container->colspan;
|
int new_col = container->col + container->colspan;
|
||||||
if (!cell_exists(new_col, container->row) ||
|
for (int i = 0; i < container->rowspan; i++)
|
||||||
CUR_TABLE[new_col][container->row]->currently_focused != NULL) {
|
if (!cell_exists(new_col, container->row + i) ||
|
||||||
|
CUR_TABLE[new_col][container->row + i]->currently_focused != NULL) {
|
||||||
LOG("cannot snap to right - the cell is already used\n");
|
LOG("cannot snap to right - the cell is already used\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -404,8 +405,9 @@ static void snap_current_container(xcb_connection_t *conn, direction_t direction
|
||||||
case D_DOWN: {
|
case D_DOWN: {
|
||||||
LOG("snapping down\n");
|
LOG("snapping down\n");
|
||||||
int new_row = container->row + container->rowspan;
|
int new_row = container->row + container->rowspan;
|
||||||
if (!cell_exists(container->col, new_row) ||
|
for (int i = 0; i < container->colspan; i++)
|
||||||
CUR_TABLE[container->col][new_row]->currently_focused != NULL) {
|
if (!cell_exists(container->col + i, new_row) ||
|
||||||
|
CUR_TABLE[container->col + i][new_row]->currently_focused != NULL) {
|
||||||
LOG("cannot snap down - the cell is already used\n");
|
LOG("cannot snap down - the cell is already used\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue