void () { if (!myEditor.getInlayModel().hasBlockElements()) return; int startX = myInsets.left; int lineCount = myEditor.getVisibleLineCount(); VisualLinesIterator visLinesIterator = new VisualLinesIterator(myEditor, myStartVisualLine); while (!visLinesIterator.atEnd()) { int visualLine = visLinesIterator.getVisualLine(); if (visualLine > myEndVisualLine || visualLine >= lineCount) break; int y = visLinesIterator.getY() + myYShift; int curY = y; List<Inlay<?>> inlaysAbove = visLinesIterator.getBlockInlaysAbove(); if (!inlaysAbove.isEmpty()) { TextAttributes attributes = getInlayAttributes(visualLine); for (Inlay inlay : inlaysAbove) { if (curY <= myClip.y + myYShift) break; int height = inlay.getHeightInPixels(); if (height > 0) { int newY = curY - height; inlay.getRenderer().paint(inlay, myGraphics, new Rectangle2D.Double(startX, newY, inlay.getWidthInPixels(), height), attributes); curY = newY; } } } curY = y + myLineHeight; List<Inlay<?>> inlaysBelow = visLinesIterator.getBlockInlaysBelow(); if (!inlaysBelow.isEmpty()) { TextAttributes attributes = getInlayAttributes(visualLine + 1); for (Inlay inlay : inlaysBelow) { if (curY >= myClip.y + myClip.height + myYShift) break; int height = inlay.getHeightInPixels(); if (height > 0) { inlay.getRenderer().paint(inlay, myGraphics, new Rectangle2D.Double(startX, curY, inlay.getWidthInPixels(), height), attributes); curY += height; } } } visLinesIterator.advance(); } }