mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
44670ebdd9
3 changed files with 21 additions and 3 deletions
|
@ -103,10 +103,9 @@ var Group = this.Group = Item.extend({
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
draw: function(ctx, param) {
|
||||||
for (var i = 0, l = this._children.length; i < l; i++) {
|
for (var i = 0, l = this._children.length; i < l; i++) {
|
||||||
|
// the group is clipped on its first child
|
||||||
|
param.clip = this._clipped && i == 0;
|
||||||
Item.draw(this._children[i], ctx, param);
|
Item.draw(this._children[i], ctx, param);
|
||||||
// TODO: Shouldn't clipping paths not be filled / stroked?
|
|
||||||
if (this._clipped && i == 0)
|
|
||||||
ctx.clip();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -273,6 +273,9 @@ var Item = this.Item = Base.extend({
|
||||||
*/
|
*/
|
||||||
visible: true,
|
visible: true,
|
||||||
|
|
||||||
|
// TODO Item#clipMask is currently not used for clipping - consider
|
||||||
|
// taking it out, as we could also simply always use the first child as the
|
||||||
|
// clipping mask.
|
||||||
/**
|
/**
|
||||||
* Specifies whether the item defines a clip mask. This can only be set on
|
* Specifies whether the item defines a clip mask. This can only be set on
|
||||||
* paths, compound paths, and text frame objects, and only if the item is
|
* paths, compound paths, and text frame objects, and only if the item is
|
||||||
|
@ -281,6 +284,7 @@ var Item = this.Item = Base.extend({
|
||||||
* @type Boolean
|
* @type Boolean
|
||||||
* @default false
|
* @default false
|
||||||
* @bean
|
* @bean
|
||||||
|
* @ignore // ignoring this until we actually make use of it for drawing
|
||||||
*/
|
*/
|
||||||
isClipMask: function() {
|
isClipMask: function() {
|
||||||
return this._clipMask;
|
return this._clipMask;
|
||||||
|
|
|
@ -114,6 +114,21 @@ test('Is the path deselected after setting a new list of segments?', function()
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('After setting Path#selected=true on an empty path, subsequent segments should be selected', function() {
|
||||||
|
var path = new Path();
|
||||||
|
path.selected = true;
|
||||||
|
equals(function() {
|
||||||
|
return path.selected;
|
||||||
|
}, true);
|
||||||
|
path.add([10, 10]);
|
||||||
|
equals(function() {
|
||||||
|
return path.selected;
|
||||||
|
}, true);
|
||||||
|
equals(function() {
|
||||||
|
return path.firstSegment.selected;
|
||||||
|
}, true);
|
||||||
|
});
|
||||||
|
|
||||||
test('Path#reverse', function() {
|
test('Path#reverse', function() {
|
||||||
var path = new Path.Circle([100, 100], 30);
|
var path = new Path.Circle([100, 100], 30);
|
||||||
path.reverse();
|
path.reverse();
|
||||||
|
|
Loading…
Reference in a new issue