diff --git a/src/item/Item.js b/src/item/Item.js index 031b0233..3dfbd4db 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -4327,8 +4327,12 @@ new function() { // Injection scope for hit-test functions shared with project // Apply the parent's global matrix to the calculation of correct // bounds. var bounds = this.getStrokeBounds(viewMatrix); - if (!bounds.width || !bounds.height) + if (!bounds.width || !bounds.height) { + // Item won't be drawn so its global matrix need to be removed + // from the stack (#1561). + matrices.pop(); return; + } // Store previous offset and save the main context, so we can // draw onto it later. prevOffset = param.offset; diff --git a/test/tests/Item_Bounds.js b/test/tests/Item_Bounds.js index b4a3ff59..f0b8ae03 100644 --- a/test/tests/Item_Bounds.js +++ b/test/tests/Item_Bounds.js @@ -789,3 +789,12 @@ test('group.internalBounds with child and child.applyMatrix = false (#1250)', fu equals(group.internalBounds, new Rectangle(0, 0, 250, 250), 'group.internalBounds after scaling item1'); }); + +test('#1561 item._globalMatrix on item after empty symbol', function(){ + var symbol = new SymbolItem(new Path()); + symbol.opacity = 0.5; + symbol.skew(10); + var item = new Path.Circle(new Point(0,0), 10); + view.update(); + equals(item._globalMatrix, new Matrix()); +});