updateSecondaryOffset method

void updateSecondaryOffset(
  1. Offset offset
)

Sets the secondaryLeft and secondaryTop correctly to the provided offset.

Implementation

void updateSecondaryOffset(Offset offset) {
  if (fullscreen.isTrue) {
    secondaryLeft.value = offset.dx - secondaryPanningOffset!.dx;
    secondaryTop.value =
        offset.dy -
        ((WebUtils.isPopup || router.context!.isMobile) ? 0 : titleHeight) -
        secondaryPanningOffset!.dy;
  } else if (WebUtils.isPopup) {
    secondaryLeft.value = offset.dx - secondaryPanningOffset!.dx;
    secondaryTop.value = offset.dy - secondaryPanningOffset!.dy;
  } else {
    secondaryLeft.value =
        offset.dx -
        (router.context!.isMobile ? 0 : left.value) -
        secondaryPanningOffset!.dx;
    secondaryTop.value =
        offset.dy -
        (router.context!.isMobile ? 0 : top.value + titleHeight) -
        secondaryPanningOffset!.dy;
  }

  if (secondaryLeft.value! < 0) {
    secondaryLeft.value = 0;
  }

  if (secondaryTop.value! < 0) {
    secondaryTop.value = 0;
  }
}