mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-28 17:02:24 -05:00
parent
4aa1bebf26
commit
e3c298d3f4
2 changed files with 14 additions and 1 deletions
|
@ -172,7 +172,7 @@ var Group = Item.extend(/** @lends Group# */{
|
|||
var clipItem = this._getClipItem();
|
||||
return clipItem
|
||||
? clipItem._getCachedBounds(
|
||||
matrix && matrix.appended(clipItem._matrix),
|
||||
matrix && matrix.appended(clipItem._matrix) || clipItem._matrix,
|
||||
Base.set({}, options, { stroke: false }))
|
||||
: _getBounds.base.call(this, matrix, options);
|
||||
},
|
||||
|
|
|
@ -166,3 +166,16 @@ test('Group#isEmpty(recursively)', function() {
|
|||
equals(false, group.isEmpty());
|
||||
equals(true, group.isEmpty(true));
|
||||
});
|
||||
|
||||
test('group.getInternalBounds() with clip item without matrix applied', function() {
|
||||
var point = new Point(100, 100);
|
||||
var translation = new Point(100, 100);
|
||||
var item = new Path.Circle({ center: point, radius: 50, fillColor: 'orange' });
|
||||
var clip = new Path.Rectangle({ from: point.subtract(translation), to: point.add(translation) });
|
||||
clip.applyMatrix = false;
|
||||
clip.translate(translation);
|
||||
var group = new Group(clip, item);
|
||||
group.clipped = true;
|
||||
|
||||
equals(group.getInternalBounds(), new Rectangle(point, point.add(translation.multiply(2))));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue