contains method
Returns true if a given child
is a descendant of this container, or
false otherwise.
Implementation
bool contains(GDisplayObject? child, [bool recursive = true]) {
if (!recursive) {
return children.contains(child);
}
while (child != null) {
if (child == this) {
return true;
}
child = child.$parent;
}
return false;
}