mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Simplify Item#_isUpdate() code a bit.
This commit is contained in:
parent
bb6e1e686f
commit
6aaeb81869
1 changed files with 8 additions and 6 deletions
|
@ -3695,8 +3695,7 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
* anymore or is invisible.
|
* anymore or is invisible.
|
||||||
*/
|
*/
|
||||||
_isUpdated: function(updateVersion) {
|
_isUpdated: function(updateVersion) {
|
||||||
var version = this._updateVersion,
|
var parent = this._parent;
|
||||||
parent = this._parent;
|
|
||||||
// For compound-paths, we need to use the _updateVersion of the parent,
|
// For compound-paths, we need to use the _updateVersion of the parent,
|
||||||
// because when using the ctx.currentPath optimization, the children
|
// because when using the ctx.currentPath optimization, the children
|
||||||
// don't have to get drawn on each frame and thus won't change their
|
// don't have to get drawn on each frame and thus won't change their
|
||||||
|
@ -3707,10 +3706,13 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
// _updateVersion of all its children will not be updated, but the
|
// _updateVersion of all its children will not be updated, but the
|
||||||
// children should still be considered updated, and selections should be
|
// children should still be considered updated, and selections should be
|
||||||
// drawn for them. Excluded are only items with _visible == false:
|
// drawn for them. Excluded are only items with _visible == false:
|
||||||
if (version !== updateVersion && parent && parent._visible
|
var updated = this._updateVersion === updateVersion;
|
||||||
&& parent._isUpdated(updateVersion))
|
if (!updated && parent && parent._visible
|
||||||
version = this._updateVersion = updateVersion;
|
&& parent._isUpdated(updateVersion)) {
|
||||||
return version === updateVersion;
|
this._updateVersion = updateVersion;
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
|
return updated;
|
||||||
},
|
},
|
||||||
|
|
||||||
_drawSelection: function(ctx, matrix, size, updateVersion) {
|
_drawSelection: function(ctx, matrix, size, updateVersion) {
|
||||||
|
|
Loading…
Reference in a new issue