void () { if (myEditor.getSettings().isRightMarginShown()) { Color visualGuidesColor = myEditor.getColorsScheme().getColor(EditorColors.VISUAL_INDENT_GUIDE_COLOR); if (visualGuidesColor != null) { myGraphics.setColor(visualGuidesColor); for (Integer marginX : myCorrector.softMarginsX()) { LinePainter2D.paint(myGraphics, marginX, 0, marginX, myClip.height); } } } if (!isMarginShown()) return; myGraphics.setColor(myEditor.getColorsScheme().getColor(EditorColors.RIGHT_MARGIN_COLOR)); float baseMarginWidth = getBaseMarginWidth(myView); int baseMarginX = myCorrector.marginX(baseMarginWidth); if (myMarginPositions == null) { LinePainter2D.paint(myGraphics, baseMarginX, 0, baseMarginX, myClip.height); } else { int displayedLinesCount = myMarginPositions.x.length - 1; for (int i = 0; i <= displayedLinesCount; i++) { float width = myMarginPositions.x[i]; int x = width == 0 ? baseMarginX : (int)width; int y = myMarginPositions.y[i]; if (i == 0 && y > myYShift) { myGraphics.fillRect(baseMarginX, myYShift, 1, y - myYShift); if (x != baseMarginX) { myGraphics.fillRect(Math.min(x, baseMarginX), y - 1, Math.abs(x - baseMarginX) + 1, 1); } } if (i < displayedLinesCount) { myGraphics.fillRect(x, y, 1, myLineHeight); float nextWidth = myMarginPositions.x[i + 1]; int nextX = nextWidth == 0 ? baseMarginX : (int)nextWidth; int nextY = myMarginPositions.y[i + 1]; if (nextY > y + myLineHeight) { if (x != baseMarginX) { myGraphics.fillRect(Math.min(x, baseMarginX), y + myLineHeight - 1, Math.abs(x - baseMarginX) + 1, 1); } myGraphics.fillRect(baseMarginX, y + myLineHeight, 1, nextY - y - myLineHeight); if (baseMarginX != nextX) { myGraphics.fillRect(Math.min(nextX, baseMarginX), nextY - 1, Math.abs(nextX - baseMarginX) + 1, 1); } } else { if (x != nextX) { myGraphics.fillRect(Math.min(x, nextX), y + myLineHeight - 1, Math.abs(x - nextX) + 1, 1); } } } else { myGraphics.fillRect(x, y, 1, myClip.y + myClip.height + myYShift - y); } } } }