if (steep) {
      let temp = fromX;
      fromX = fromY;
      fromY = temp;
      temp = toX;