Offset clamp(Offset min, Offset max) { return Offset( clampDouble(dx, min.dx, max.dx), clampDouble(dy, min.dy, max.dy), ); }