static double @NotNull [] alignSizeXY(@NotNull Graphics2D g,
                                        double xy, double prefSize,
                                        @NotNull StrokeType strokeType, double strokeWidth, boolean rectangle) {
    prefSize = PaintUtil.alignToInt(prefSize, g);
    // if xy is (close to) dev int the resulting size should be EVEN, otherwise ODD - to compensate the middle dev pixel
    double _xy = PaintUtil.alignToInt(xy + 0.000001, g, RoundingMode.FLOOR);
    ParityMode pm = Double.compare(_xy, xy) == 0 ? ParityMode.EVEN : ParityMode.ODD;
    double sw_1 = 0; // stroke split for rect, and caps for line with CENTERED_CAPS_SQUARE
    double sw_2 = 0;
    if (rectangle || strokeType == StrokeType.CENTERED_CAPS_SQUARE) {
      double[] strokeSplit = getStrokeSplit(ScaleContext.create(g), strokeType, strokeWidth, false);
      sw_1 = strokeSplit[0];
      sw_2 = strokeSplit[0];
    }
    double sizeWithStroke = sw_1 + prefSize + sw_2;
    if (PaintUtil.getParityMode(sizeWithStroke, g) != pm) {
      prefSize = PaintUtil.alignToInt(prefSize, g, ParityMode.invert(PaintUtil.getParityMode(prefSize, g)));
      sizeWithStroke = sw_1 + prefSize + sw_2;
    }
    _xy -= (pm == ParityMode.ODD ? sizeWithStroke - PaintUtil.devPixel(g) : sizeWithStroke) / 2 - sw_1;
    return new double[]{_xy, prefSize};
  }
static double @NotNull [] alignSizeXY(@NotNull Graphics2D g,
                                        double xy, double prefSize,
                                        @NotNull StrokeType strokeType, double strokeWidth, boolean rectangle)