mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
42e8f787ee
4 changed files with 24 additions and 5 deletions
|
@ -34,12 +34,12 @@
|
|||
}
|
||||
|
||||
function onMouseDown(event) {
|
||||
path.selected = true;
|
||||
path.fullySelected = true;
|
||||
path.strokeColor = '#e08285';
|
||||
}
|
||||
|
||||
function onMouseUp(event) {
|
||||
path.selected = false;
|
||||
path.fullySelected = false;
|
||||
path.strokeColor = '#e4141b';
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
[[width / 2, y], vector.rotate(-180), vector],
|
||||
[[width - offset, y], vector.rotate(90), null]
|
||||
];
|
||||
path.selected = true;
|
||||
path.fullySelected = true;
|
||||
|
||||
function onMouseMove(event) {
|
||||
var point = event.point.clone();
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
}
|
||||
|
||||
var path = makePath();
|
||||
path.selected = true;
|
||||
path.fullySelected = true;
|
||||
path.strokeColor = 'black';
|
||||
path.strokeCap = 'butt';
|
||||
path.strokeJoin = 'round';
|
||||
|
|
|
@ -129,6 +129,25 @@ test('After setting Path#fullySelected=true on an empty path, subsequent segment
|
|||
}, true);
|
||||
});
|
||||
|
||||
test('After removing all segments of a fully selected path, it should still be fully selected.', function() {
|
||||
var path = new Path([10, 20], [30, 40]);
|
||||
path.fullySelected = true;
|
||||
path.removeSegments();
|
||||
equals(function() {
|
||||
return path.fullySelected;
|
||||
}, true);
|
||||
});
|
||||
|
||||
test('After removing all segments of a selected path, it should still be selected.', function() {
|
||||
var path = new Path([10, 20], [30, 40]);
|
||||
path.selected = true;
|
||||
path.removeSegments();
|
||||
equals(function() {
|
||||
return path.selected;
|
||||
}, true);
|
||||
});
|
||||
|
||||
|
||||
test('After simplifying a path using #pointToCurves(), the path should stay fullySelected', function() {
|
||||
var path = new Path();
|
||||
for (var i = 0; i < 30; i++) {
|
||||
|
@ -173,7 +192,7 @@ test('After smoothing a path using #smooth(), the path should stay selected', fu
|
|||
path.selected = true;
|
||||
path.smooth();
|
||||
equals(function() {
|
||||
return path.fullySelected;
|
||||
return path.selected;
|
||||
}, true);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue