void (@NotNull Graphics2D g, int x1, int x2, int y1, int y2, int lineHeight, boolean isHovered, @Nullable EditorColorsScheme scheme) { if (x1 == x2) return; int step = getStepSize(lineHeight); int height = getHeight(lineHeight); int extraGap = getAAGap(); int verticalOffset = getVerticalOffset(lineHeight); int verticalAlign = verticalOffset + height + extraGap; y1 += verticalAlign; y2 += verticalAlign; Path2D path = new Path2D.Double(); // 0.5f: fix rounding issues in mirrored mode, with scale(*-1*, 1) path.moveTo(x1 - 0.5f, y1); double delta = (double)Math.abs(y2 - y1) / Math.abs(x2 - x1); if (delta < 0.2) { double middleX = (double)(x1 + x2) / 2; double middleY = (double)(y1 + y2) / 2; if (x2 - x1 > 5 * step) { path.quadTo(x1 + step * 0.5, y1 + height, x1 + step, y1 + height); path.quadTo(x1 + step * 1.5, y1 + height, x1 + step * 2.0, middleY); path.quadTo(x1 + step * 2.5, middleY - height, middleX, middleY - height); path.quadTo(x2 - step * 2.5, middleY - height, x2 - step * 2.0, middleY); path.quadTo(x2 - step * 1.5, y2 + height, x2 - step * 1.0, y2 + height); path.quadTo(x2 - step * 0.5, y2 + height, x2, y2); } else { // fallback: divider has the wrong size. Can't fit 6 half-periods nicely - use 2 half-periods instead. path.quadTo(middleX, middleY + 2 * height, x2, y2); } } else if (y1 > y2) { path.curveTo(x1 + step * 0.125, y1 + height * 0.125, x1 + step * 0.125, y1 + height * 0.5, x1 + step * 0.5, y1 + height * 0.5); path.curveTo(x2 - step * 2.0, y1 + height * 0.5, x2 - step * 2.0, y2 + 2 * height * 2.0, x2, y2); } else { path.curveTo(x1 + step * 2.0, y1 + 2 * height * 2.0, x1 + step * 2.0, y2 + height * 0.5, x2 - step * 0.5, y2 + height * 0.5); path.curveTo(x2 - step * 0.125, y2 + height * 0.5, x2 - step * 0.125, y2 + height * 0.125, x2, y2); } g.setColor(getWaveColor(scheme)); g.setStroke(getStroke(isHovered)); g.draw(path); }