intersectsViewport property
bool
get
intersectsViewport
Implementation
bool get intersectsViewport {
// logicalBounds is node-local. Translate to global via the relationship
// globalOrigin = logicalCenter - bounds.center. Exact for axis-aligned
// non-transformed boxes.
final globalLeft = logicalCenter.x - (logicalBounds.x + logicalBounds.w / 2);
final globalTop = logicalCenter.y - (logicalBounds.y + logicalBounds.h / 2);
final globalRight = globalLeft + logicalBounds.w;
final globalBottom = globalTop + logicalBounds.h;
if (globalRight <= 0 || globalBottom <= 0) return false;
if (globalLeft >= logicalViewSize.w) return false;
if (globalTop >= logicalViewSize.h) return false;
final c = clip;
if (c == null) return true;
return globalRight > c.x && globalBottom > c.y && globalLeft < c.x + c.w && globalTop < c.y + c.h;
}