Make lua selection grow create a new selection
This commit is contained in:
@@ -292,6 +292,36 @@ function test_sel_randline()
|
||||
end
|
||||
end -- test_sel_randline
|
||||
|
||||
function test_sel_grow()
|
||||
local __func__ = "test_sel_grow";
|
||||
local sela = selection.new();
|
||||
|
||||
sela:set(5,5);
|
||||
|
||||
local sela_clone = sela:clone();
|
||||
|
||||
local selb = sela:grow();
|
||||
sel_are_equal(sela, sela_clone, __func__);
|
||||
sel_has_n_points(selb, 9, __func__);
|
||||
for x = 4,6 do
|
||||
for y = 4,6 do
|
||||
sel_pt_ne(selb, x,y, 1, __func__);
|
||||
end
|
||||
end
|
||||
|
||||
local selc = sela:grow("north");
|
||||
sel_has_n_points(selc, 2, __func__);
|
||||
sel_pt_ne(selc, 5,5, 1, __func__);
|
||||
sel_pt_ne(selc, 5,4, 1, __func__);
|
||||
|
||||
local seld = selc:grow("east");
|
||||
sel_has_n_points(seld, 4, __func__);
|
||||
sel_pt_ne(seld, 5,5, 1, __func__);
|
||||
sel_pt_ne(seld, 5,4, 1, __func__);
|
||||
sel_pt_ne(seld, 6,5, 1, __func__);
|
||||
sel_pt_ne(seld, 6,4, 1, __func__);
|
||||
end -- test_sel_grow
|
||||
|
||||
test_selection_params();
|
||||
test_sel_negate();
|
||||
test_sel_logical_and();
|
||||
@@ -302,3 +332,4 @@ test_sel_line();
|
||||
test_sel_rect();
|
||||
test_sel_fillrect();
|
||||
test_sel_randline();
|
||||
test_sel_grow();
|
||||
|
||||
Reference in New Issue
Block a user