made performance improvement for isVisible method, suggested by mysza

This commit is contained in:
Eric Rowell 2012-07-03 12:59:31 -07:00
parent 3d4d2d20c0
commit 17644fcb8f
3 changed files with 4 additions and 4 deletions

View File

@ -673,7 +673,7 @@ Kinetic.Node = Kinetic.Class.extend({
* is invisible, this means that the shape is also invisible
*/
isVisible: function() {
if(this.getParent() && !this.getParent().isVisible()) {
if(this.attrs.visible && this.getParent() && !this.getParent().isVisible()) {
return false;
}
return this.attrs.visible;

File diff suppressed because one or more lines are too long

View File

@ -262,7 +262,7 @@ Kinetic.Node = Kinetic.Class.extend({
* is invisible, this means that the shape is also invisible
*/
isVisible: function() {
if(this.getParent() && !this.getParent().isVisible()) {
if(this.attrs.visible && this.getParent() && !this.getParent().isVisible()) {
return false;
}
return this.attrs.visible;