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:
VladimirTechMan 2019-01-21 23:50:07 +03:00
parent 81b71d76a4
commit d823beefb0

View File

@ -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;