expand method

void expand(
  1. Vector4 v1,
  2. Vector4 v2,
  3. double pixels
)

Implementation

void expand(Vector4 v1, Vector4 v2, double pixels) {
  num x = v2.x - v1.x;
  num y = v2.y - v1.y;
  num det = x * x + y * y;
  if (det == 0) return;
  num idet = pixels / Math.sqrt(det);
  x *= idet;
  y *= idet;
  v2.x += x;
  v2.y += y;
  v1.x -= x;
  v1.y -= y;
}