public static void paintPolygon(@NotNull Graphics2D g,
                                  double @NotNull [] xPoints, double @NotNull [] yPoints,
                                  int nPoints,
                                  @NotNull StrokeType strokeType, double strokeWidth,
                                  @NotNull Object valueAA) {
    boolean thickPixel = JreHiDpiUtil.isJreHiDPIEnabled() && PaintUtil.devValue(strokeWidth, g) > 1;
    boolean prevStraight = nPoints <= 1 || isStraightLine(xPoints, yPoints, nPoints, nPoints);

    for (int p = 0; p < nPoints; p++) {
      double x1 = xPoints[p];
      double y1 = yPoints[p];
      double x2 = xPoints[(p + 1) % nPoints];
      double y2 = yPoints[(p + 1) % nPoints];
      boolean thisStraight = x1 == x2 || y1 == y2;
      // [tav] todo: mind the angle, the strokeWidth and the strokeType
      if (thickPixel && !thisStraight) {
        if (prevStraight) {
          x1 += 0.5;
          y1 += 0.5;
        }
        if (isStraightLine(xPoints, yPoints, p + 1, nPoints)) {
          x2 += 0.5;
          y2 += 0.5;
        }
      }
      prevStraight = thisStraight;
      paint(g, x1, y1, x2, y2, strokeType, strokeWidth, valueAA);
    }
  }
public static void paintPolygon(@NotNull Graphics2D g,
                                  double @NotNull [] xPoints, double @NotNull [] yPoints,
                                  int nPoints,
                                  @NotNull StrokeType strokeType, double strokeWidth,
                                  @NotNull Object valueAA)