bg = getGutter().getBackground();
}
g.setColor(bg);
g.fillRect(0,visibleRect.y, getWidth(),visibleRect.height);
RSyntaxTextArea rsta = (RSyntaxTextArea)textArea;
if (!rsta.isCodeFoldingEnabled()) {
return; // We should be hidden in this case, but still...
}
if (textArea.getLineWrap()) {
paintComponentWrapped(g);
return;
}
// Get where to start painting (top of the row).
// We need to be "scrolled up" up just enough for the missing part of
// the first line.
textAreaInsets = textArea.getInsets(textAreaInsets);
if (visibleRect.y<textAreaInsets.top) {
visibleRect.height -= (textAreaInsets.top - visibleRect.y);
visibleRect.y = textAreaInsets.top;
}
int cellHeight = textArea.getLineHeight();
int topLine = (visibleRect.y-textAreaInsets.top)/cellHeight;
int y = topLine*cellHeight +
(cellHeight-collapsedFoldIcon.getIconHeight())/2;
y += textAreaInsets.top;
// Get the first and last lines to paint.
FoldManager fm = rsta.getFoldManager();
topLine += fm.getHiddenLineCountAbove(topLine, true);
int width = getWidth();
int x = width - 10;
int line = topLine;