Update Item#_updateVersion in Item#draw() before bailing out when items are invisible.

Closes #469.
This commit is contained in:
Jürg Lehni 2014-05-05 20:13:36 +02:00
parent 74d14ecf0c
commit 312e670b22

View file

@ -2334,7 +2334,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
/** /**
* {@grouptitle Style Tests} * {@grouptitle Style Tests}
* *
* Checks whether the item has a fill. * Checks whether the item has a fill.
* *
* @return {Boolean} {@true if 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) { draw: function(ctx, param) {
if (!this._visible || this._opacity === 0)
return;
// Each time the project gets drawn, it's _updateVersion is increased. // Each time the project gets drawn, it's _updateVersion is increased.
// Keep the _updateVersion of drawn items in sync, so we have an easy // 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. // way to know for which selected items we need to draw selection info.
var updateVersion = this._updateVersion = this._project._updateVersion; 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 // Keep calculating the current global matrix, by keeping a history
// and pushing / popping as we go along. // and pushing / popping as we go along.
var matrices = param.matrices, var matrices = param.matrices,