void (@NotNull Graphics2D g, @Nullable Caret caret, float x, float y, float w, boolean isRtl) { // We only draw the RTL marker for bar carets. If our bar is close to being a block, skip it. We keep the entire caret inside the // caret location width. if (myDocument.getTextLength() > 0 && caret != null && !myView.getTextLayoutCache().getLineLayout(caret.getLogicalPosition().line).isLtr()) { GeneralPath triangle = new GeneralPath(Path2D.WIND_NON_ZERO, 3); triangle.moveTo(isRtl ? x : x + w, y); triangle.lineTo(isRtl ? x - CARET_DIRECTION_MARK_SIZE : x + w + CARET_DIRECTION_MARK_SIZE, y); triangle.lineTo(isRtl ? x : x + w, y + CARET_DIRECTION_MARK_SIZE); triangle.closePath(); g.fill(triangle); } }