int baseline = (int) Math.round((this.baseline + lineHeight
int baseline = (int)((this.baseline + lineHeight
	public void paintComponent(Graphics gfx)	{		// fill the background		Rectangle clip = gfx.getClipBounds();		gfx.setColor(getBackground());		gfx.fillRect(clip.x, clip.y, clip.width, clip.height);		// if buffer is loading, don't paint anything		if (!textArea.getBuffer().isLoaded())			return;		// paint highlights and line numbers		int lineHeight = textArea.getPainter().getFontMetrics()			.getHeight();		int firstLine = clip.y / lineHeight + textArea.getFirstLine();		int lastLine = (clip.y + clip.height - 1) / lineHeight			+ textArea.getFirstLine();		FontMetrics pfm = textArea.getPainter().getFontMetrics();		Color fg = getForeground();		int baseline = (int) Math.round((this.baseline + lineHeight			- pfm.getDescent()) / 2.0);		boolean highlightCurrentLine = currentLineHighlightEnabled			&& (textArea.getSelectionStart() == textArea.getSelectionEnd());		int y = (clip.y - clip.y % lineHeight);		Buffer buffer = textArea.getBuffer();		int firstValidLine = firstLine >= 0 ? firstLine : 0;		int lastValidLine = (lastLine >= buffer.getVirtualLineCount())			? buffer.getVirtualLineCount() - 1 : lastLine;		for (int line = firstLine; line <= lastLine;			line++, y += lineHeight)		{			boolean valid = (line >= firstValidLine && line <= lastValidLine);			if(highlights != null)				highlights.paintHighlight(gfx, line, y);			if(!valid)				return;			// calculate the physical line			int physicalLine = buffer.virtualToPhysical(line);			if(physicalLine != buffer.getLineCount() - 1)			{				if(buffer.isFoldStart(physicalLine))				{					gfx.setColor(foldColor);					if(buffer.isLineVisible(physicalLine + 1))						gfx.drawRect(2,y + (lineHeight - 6) / 2,5,5);					else						gfx.fillRect(2,y + (lineHeight - 6) / 2,6,6);				}			}			if (!expanded)				continue;			String number = Integer.toString(physicalLine + 1);			int offset;			switch (alignment)			{			case RIGHT:				offset = gutterSize.width - collapsedSize.width					- (fm.stringWidth(number) + 1);				break;			case CENTER:				offset = ((gutterSize.width - collapsedSize.width)					- fm.stringWidth(number)) / 2;				break;			case LEFT: default:				offset = 0;			}			if (physicalLine == textArea.getCaretLine() && highlightCurrentLine)				gfx.setColor(currentLineHighlight);			else if (interval > 1 && (line + 1) % interval == 0)				gfx.setColor(intervalHighlight);			else				gfx.setColor(fg);			gfx.drawString(number, FOLD_MARKER_SIZE + offset,				baseline + y);		}	}