private float thin_flat_line_slope(float x1, float y1,
                                      float x2, float y2, int border) {
      switch (border) {
      case 4: {
        return (-y1)/(y2-y1);
      }
      case 3: {
        return (height1-y1)/(y2-y1);
      }
      case 2: {
        return (-x1)/(x2-x1);
      }
      case 1: {
        return (width1-x1)/(x2-x1);
      }
      }
      return -1f;
    }