From 41feaebb4e80567838a4ce57a911b381f27688b6 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Tue, 14 Jun 2011 12:15:46 +0200 Subject: [PATCH] Fix Group clipping and ignore Item#clipMask in the documentation for now. --- src/item/Group.js | 5 ++--- src/item/Item.js | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/item/Group.js b/src/item/Group.js index eb16ba08..03be8f00 100644 --- a/src/item/Group.js +++ b/src/item/Group.js @@ -103,10 +103,9 @@ var Group = this.Group = Item.extend({ draw: function(ctx, param) { 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); - // TODO: Shouldn't clipping paths not be filled / stroked? - if (this._clipped && i == 0) - ctx.clip(); } } }); diff --git a/src/item/Item.js b/src/item/Item.js index c1f88ec8..4ed5a990 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -273,6 +273,9 @@ var Item = this.Item = Base.extend({ */ 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 * 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 * @default false * @bean + * @ignore // ignoring this until we actually make use of it for drawing */ isClipMask: function() { return this._clipMask;