along static method

Offset along(
  1. Size view,
  2. FPortalChildBox child,
  3. FPortalBox portal
)

Shifts the portal along the child's edge if the portal overflows out of the viewport.

Implementation

static Offset along(Size view, FPortalChildBox child, FPortalBox portal) {
  final anchor = none(view, child, portal).translate(child.offset.dx, child.offset.dy);

  final viewBox = Offset.zero & view;
  final portalBox = anchor & portal.size;

  return _along(anchor, viewBox, portalBox).translate(-child.offset.dx, -child.offset.dy);
}