mirror of
https://github.com/konvajs/konva.git
synced 2025-12-04 19:08:24 +08:00
made performance improvement for isVisible method, suggested by mysza
This commit is contained in:
2
dist/kinetic-core.js
vendored
2
dist/kinetic-core.js
vendored
@@ -673,7 +673,7 @@ Kinetic.Node = Kinetic.Class.extend({
|
|||||||
* is invisible, this means that the shape is also invisible
|
* is invisible, this means that the shape is also invisible
|
||||||
*/
|
*/
|
||||||
isVisible: function() {
|
isVisible: function() {
|
||||||
if(this.getParent() && !this.getParent().isVisible()) {
|
if(this.attrs.visible && this.getParent() && !this.getParent().isVisible()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return this.attrs.visible;
|
return this.attrs.visible;
|
||||||
|
|||||||
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -262,7 +262,7 @@ Kinetic.Node = Kinetic.Class.extend({
|
|||||||
* is invisible, this means that the shape is also invisible
|
* is invisible, this means that the shape is also invisible
|
||||||
*/
|
*/
|
||||||
isVisible: function() {
|
isVisible: function() {
|
||||||
if(this.getParent() && !this.getParent().isVisible()) {
|
if(this.attrs.visible && this.getParent() && !this.getParent().isVisible()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return this.attrs.visible;
|
return this.attrs.visible;
|
||||||
|
|||||||
Reference in New Issue
Block a user