public void drawSelection(Graphics2D g) {
		/* which is the top one */
		Point top;
		Point bottom;
		Style current = styleState.getCurrent();
		g.setColor(current.getForeground());
		g.setXORMode(current.getBackground());
		if (selectionStart == null || selectionEnd == null)
			return;

		if (selectionStart.y == selectionEnd.y) {
			/* same line */
			if (selectionStart.x == selectionEnd.x)
				return;
			top = selectionStart.x < selectionEnd.x ? selectionStart
					: selectionEnd;
			bottom = selectionStart.x >= selectionEnd.x ? selectionStart
					: selectionEnd;

			g.fillRect(top.x * charSize.width, (top.y - clientScrollOrigin) * charSize.height,
					(bottom.x - top.x) * charSize.width, charSize.height);

		} else {
			top = selectionStart.y < selectionEnd.y ? selectionStart
					: selectionEnd;
			bottom = selectionStart.y > selectionEnd.y ? selectionStart
					: selectionEnd;
			/* to end of first line */
			g.fillRect(top.x * charSize.width, (top.y - clientScrollOrigin) * charSize.height,
					(termSize.width - top.x) * charSize.width, charSize.height);

			if (bottom.y - top.y > 1) {
				/* intermediate lines */
				g.fillRect(0, (top.y + 1 - clientScrollOrigin) * charSize.height,
						termSize.width * charSize.width, (bottom.y - top.y - 1)
								* charSize.height);
			}

			/* from beginning of last line */

			g.fillRect(0, (bottom.y  - clientScrollOrigin) * charSize.height, bottom.x
					* charSize.width, charSize.height);
		}
	}