updateOffset method

void updateOffset(
  1. Offset offset
)

Sets the left and top correctly to the provided offset.

Implementation

void updateOffset(Offset offset) {
  left.value = offset.dx - this.offset!.dx;
  top.value = offset.dy - this.offset!.dy;

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

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