Change behavior of Path#fullySelected.

Setting it on empty paths does the same as Path#selected.
This commit is contained in:
Jürg Lehni 2013-10-17 12:03:46 +02:00
parent c2a34d9f1f
commit 3958d35f28
2 changed files with 21 additions and 17 deletions

View file

@ -126,27 +126,29 @@ test('Is the path deselected after setting a new list of segments?', function()
}, 1);
});
test('After setting Path#fullySelected=true on an empty path, subsequent segments should be selected', function() {
test('Setting Path#fullySelected=true on an empty path should only set path#selected=true', function() {
var path = new Path();
path.fullySelected = true;
equals(function() {
return path.fullySelected;
}, true);
path.add([10, 10]);
}, false);
equals(function() {
return path.fullySelected;
}, true);
equals(function() {
return path.firstSegment.selected;
return path.selected;
}, true);
});
test('After removing all segments of a fully selected path, it should still be fully selected.', function() {
test('After removing all segments of a fully selected path, it should still be selected.', function() {
var path = new Path([10, 20], [30, 40]);
path.fullySelected = true;
equals(function() {
return path.fullySelected;
}, true);
path.removeSegments();
equals(function() {
return path.fullySelected;
}, false);
equals(function() {
return path.selected;
}, true);
});
@ -175,6 +177,7 @@ test('After simplifying a path using #simplify(), the path should stay fullySele
equals(function() {
return path.selected;
}, true);
equals(function() {
return path.fullySelected;
}, true);