mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Simpler code logic for Node._isVisible()
The original logic can be implemented in a more compact and clear way while producing the same results.
This commit is contained in:
parent
81b71d76a4
commit
d823beefb0
@ -864,15 +864,10 @@ export abstract class Node {
|
||||
var visible = this.visible(),
|
||||
parent = this.getParent();
|
||||
|
||||
if (relativeTo === parent && visible === 'inherit') {
|
||||
return true;
|
||||
} else if (relativeTo === parent) {
|
||||
return visible;
|
||||
}
|
||||
// the following conditions are a simplification of the truth table above.
|
||||
// please modify carefully
|
||||
if (visible === 'inherit') {
|
||||
if (parent) {
|
||||
if (parent && parent !== relativeTo) {
|
||||
return parent._isVisible(relativeTo);
|
||||
} else {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user