void (@NotNull Graphics2D g, int x1, int x2, int start1, int end1, int start2, int end2, @Nullable Color fillColor, @Nullable Color borderColor) { if (fillColor != null) { g.setColor(fillColor); g.fill(makeCurvePath(x1, x2, start1, start2, end1 + 1, end2 + 1)); // 'g.fill' above draws thin line when used with high slopes. Here we ensure that background is never less than 1px thick. Stroke oldStroke = g.getStroke(); g.setStroke(new BasicStroke(JBUIScale.scale(1f))); g.draw(makeCurve(x1, x2, (start1 + end1) / 2, (start2 + end2) / 2, true)); g.setStroke(oldStroke); } if (borderColor != null) { g.setColor(borderColor); drawCurveLine(g, x1, x2, start1, start2); drawCurveLine(g, x1, x2, end1, end2); } }