From 312e670b22508dd768e04fa721a03b464fa577ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 5 May 2014 20:13:36 +0200 Subject: [PATCH] Update Item#_updateVersion in Item#draw() before bailing out when items are invisible. Closes #469. --- src/item/Item.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index c01866b4..50217fa7 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -2334,7 +2334,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{ /** * {@grouptitle Style Tests} - * + * * Checks whether the item has a fill. * * @return {Boolean} {@true if the item has a fill} @@ -3574,12 +3574,13 @@ var Item = Base.extend(Callback, /** @lends Item# */{ }, draw: function(ctx, param) { - if (!this._visible || this._opacity === 0) - return; // Each time the project gets drawn, it's _updateVersion is increased. // Keep the _updateVersion of drawn items in sync, so we have an easy // way to know for which selected items we need to draw selection info. var updateVersion = this._updateVersion = this._project._updateVersion; + // Now bail out if no actual drawing is required. + if (!this._visible || this._opacity === 0) + return; // Keep calculating the current global matrix, by keeping a history // and pushing / popping as we go along. var matrices = param.matrices,