Fix 'border toggle' (it "skipped" 1px border) (Thanks joepd)
fixes #818
This commit is contained in:
parent
cd2a1267c8
commit
5d8e3f58f6
|
@ -799,11 +799,11 @@ void cmd_border(I3_CMD, char *border_style_str, char *border_width ) {
|
||||||
border_style++;
|
border_style++;
|
||||||
border_style %= 3;
|
border_style %= 3;
|
||||||
if (border_style == BS_NORMAL)
|
if (border_style == BS_NORMAL)
|
||||||
current->con->current_border_width = 2;
|
tmp_border_width = 2;
|
||||||
else if (border_style == BS_NONE)
|
else if (border_style == BS_NONE)
|
||||||
current->con->current_border_width = 0;
|
tmp_border_width = 0;
|
||||||
else if (border_style == BS_PIXEL)
|
else if (border_style == BS_PIXEL)
|
||||||
current->con->current_border_width = 1;
|
tmp_border_width = 1;
|
||||||
} else {
|
} else {
|
||||||
if (strcmp(border_style_str, "normal") == 0)
|
if (strcmp(border_style_str, "normal") == 0)
|
||||||
border_style = BS_NORMAL;
|
border_style = BS_NORMAL;
|
||||||
|
|
|
@ -29,25 +29,31 @@ is($nodes[0]->{border}, 'normal', 'border style normal');
|
||||||
cmd 'border 1pixel';
|
cmd 'border 1pixel';
|
||||||
@nodes = @{get_ws_content($tmp)};
|
@nodes = @{get_ws_content($tmp)};
|
||||||
is($nodes[0]->{border}, 'pixel', 'border style 1pixel');
|
is($nodes[0]->{border}, 'pixel', 'border style 1pixel');
|
||||||
|
is($nodes[0]->{current_border_width}, 1, 'border width = 1px');
|
||||||
|
|
||||||
cmd 'border none';
|
cmd 'border none';
|
||||||
@nodes = @{get_ws_content($tmp)};
|
@nodes = @{get_ws_content($tmp)};
|
||||||
is($nodes[0]->{border}, 'none', 'border style none');
|
is($nodes[0]->{border}, 'none', 'border style none');
|
||||||
|
is($nodes[0]->{current_border_width}, 0, 'border width = 0px');
|
||||||
|
|
||||||
cmd 'border normal';
|
cmd 'border normal';
|
||||||
@nodes = @{get_ws_content($tmp)};
|
@nodes = @{get_ws_content($tmp)};
|
||||||
is($nodes[0]->{border}, 'normal', 'border style back to normal');
|
is($nodes[0]->{border}, 'normal', 'border style back to normal');
|
||||||
|
is($nodes[0]->{current_border_width}, 2, 'border width = 2px');
|
||||||
|
|
||||||
cmd 'border toggle';
|
cmd 'border toggle';
|
||||||
@nodes = @{get_ws_content($tmp)};
|
@nodes = @{get_ws_content($tmp)};
|
||||||
is($nodes[0]->{border}, 'none', 'border style none');
|
is($nodes[0]->{border}, 'none', 'border style none');
|
||||||
|
is($nodes[0]->{current_border_width}, 0, 'border width = 0px');
|
||||||
|
|
||||||
cmd 'border toggle';
|
cmd 'border toggle';
|
||||||
@nodes = @{get_ws_content($tmp)};
|
@nodes = @{get_ws_content($tmp)};
|
||||||
is($nodes[0]->{border}, 'pixel', 'border style 1pixel');
|
is($nodes[0]->{border}, 'pixel', 'border style 1pixel');
|
||||||
|
is($nodes[0]->{current_border_width}, 1, 'border width = 1px');
|
||||||
|
|
||||||
cmd 'border toggle';
|
cmd 'border toggle';
|
||||||
@nodes = @{get_ws_content($tmp)};
|
@nodes = @{get_ws_content($tmp)};
|
||||||
is($nodes[0]->{border}, 'normal', 'border style back to normal');
|
is($nodes[0]->{border}, 'normal', 'border style back to normal');
|
||||||
|
is($nodes[0]->{current_border_width}, 2, 'border width = 2px');
|
||||||
|
|
||||||
done_testing;
|
done_testing;
|
||||||
|
|
Loading…
Reference in New Issue