Index: TermView.cpp
===================================================================
--- TermView.cpp	(révision 24661)
+++ TermView.cpp	(copie de travail)
@@ -58,6 +58,8 @@
 	{245, 245, 245, 0},	// white
 };
 
+//Space at the borders of the view
+#define OFFSET 3
 
 #define ROWS_DEFAULT 25
 #define COLUMNS_DEFAULT 80
@@ -332,9 +334,9 @@
 TermView::GetPreferredSize(float *width, float *height)
 {
 	if (width)
-		*width = fTermColumns * fFontWidth;
+		*width = fTermColumns * fFontWidth + 2 * OFFSET;
 	if (height)
-		*height = fTermRows * fFontHeight;
+		*height = fTermRows * fFontHeight + 2 * OFFSET;
 }
 
 
@@ -371,7 +373,7 @@
 	fScrTop = 0;
 	fScrBot = fTermRows - 1;
 
-	BRect rect(0, 0, fTermColumns * fFontWidth, fTermRows * fFontHeight);
+	BRect rect(0, 0, fTermColumns * fFontWidth + 2 * OFFSET, fTermRows * fFontHeight + 2 * OFFSET);
 
 	if (resize)
 		ResizeTo(rect.Width(), rect.Height());
@@ -941,14 +943,16 @@
 void
 TermView::DrawCursor()
 {
-	BRect rect(fFontWidth * fCurPos.x, fFontHeight * fCurPos.y + fTop,
-		fFontWidth * (fCurPos.x + 1) - 1, fFontHeight * fCurPos.y + fTop + fCursorHeight - 1);
+	BRect rect(fFontWidth * fCurPos.x + OFFSET,
+		fFontHeight * fCurPos.y + fTop + OFFSET,
+		fFontWidth * (fCurPos.x + 1) - 1 + OFFSET,
+		fFontHeight * fCurPos.y + fTop + fCursorHeight - 1 + OFFSET);
 
 	uchar buf[4];
 	ushort attr;
 
-	int top = fTop / fFontHeight;
-	bool m_flag = _CheckSelectedRegion(CurPos(fCurPos.x, fCurPos.y + fTop / fFontHeight));
+	int top = (fTop + OFFSET) / fFontHeight;
+	bool m_flag = _CheckSelectedRegion(CurPos(fCurPos.x, fCurPos.y + top));
 	if (fTextBuffer->GetChar(fCurPos.y + top, fCurPos.x, buf, &attr) == A_CHAR) {
 		int width;
 		if (IS_WIDTH(attr))
@@ -1110,6 +1114,10 @@
 
 	inView->SetFont(&fHalfFont);
 
+	//Move the whole thing to the right
+	x1 += OFFSET;
+	y1 += OFFSET;
+
 	// Set pen point
 	int x2 = x1 + fFontWidth * width;
 	int y2 = y1 + fFontHeight;
@@ -1325,11 +1333,11 @@
 		return;
 	}
 
-	int x1 =(int)updateRect.left / fFontWidth;
-	int x2 =(int)updateRect.right / fFontWidth;
+	int x1 =(int)(updateRect.left - OFFSET) / fFontWidth;
+	int x2 =(int)(updateRect.right - OFFSET) / fFontWidth;
 
-	int y1 =(int)updateRect.top / fFontHeight;
-	int y2 =(int)updateRect.bottom / fFontHeight;
+	int y1 =(int)(updateRect.top - OFFSET) / fFontHeight;
+	int y2 =(int)(updateRect.bottom - OFFSET) / fFontHeight;
 
 	Window()->BeginViewTransaction();
 
@@ -1354,10 +1362,10 @@
 			if (count < 0) {
 				if (insideSelection) {
 					BRect eraseRect;
-					eraseRect.Set(fFontWidth * i,
-						fFontHeight * j,
-						fFontWidth * (i - count) -1,
-						fFontHeight * (j + 1) -1);
+					eraseRect.Set(fFontWidth * i + OFFSET,
+					    fFontHeight * j + OFFSET,
+					    fFontWidth * (i - count) -1 + OFFSET,
+					    fFontHeight * (j + 1) -1 + OFFSET);
 
 					SetHighColor(fSelectBackColor);
 					FillRect(eraseRect);
@@ -1389,15 +1397,16 @@
 
 	const int numLines =(int)((updateRect.Height()) / fFontHeight);
 
-	int y1 =(int)updateRect.top / fFontHeight;
+	int y1 =(int)(updateRect.top - OFFSET) / fFontHeight;
 	y1 = y1 -(fScrBufSize - numLines * 2);
 	if (y1 < 0)
 		y1 = 0;
 
+
 	const int y2 = y1 + numLines -1;
 
-	const int x1 =(int)updateRect.left / fFontWidth;
-	const int x2 =(int)updateRect.right / fFontWidth;
+	const int x1 =(int)(updateRect.left - OFFSET) / fFontWidth;
+	const int x2 =(int)(updateRect.right - OFFSET) / fFontWidth;
 
 	for (int j = y1; j <= y2; j++) {
 		// If(x1, y1) Buffer is in string full width character,
@@ -1590,8 +1599,8 @@
 void
 TermView::FrameResized(float width, float height)
 {
-	const int cols = ((int)width + 1) / fFontWidth;
-	const int rows = ((int)height + 1) / fFontHeight;
+	const int cols = ((int)width + 1 - 2 * OFFSET) / fFontWidth;
+	const int rows = ((int)height + 1 - 2 * OFFSET) / fFontHeight;
 	
 	int offset = 0;
 
@@ -2166,7 +2175,7 @@
 CurPos
 TermView::_ConvertToTerminal(const BPoint &p)
 {
-	return CurPos(p.x / fFontWidth, p.y / fFontHeight);
+	return CurPos((p.x - OFFSET) / fFontWidth, (p.y - OFFSET) / fFontHeight);
 }
 
 
@@ -2174,7 +2183,7 @@
 BPoint
 TermView::_ConvertFromTerminal(const CurPos &pos)
 {
-	return BPoint(fFontWidth * pos.x, pos.y * fFontHeight + fTop);
+	return BPoint(fFontWidth * pos.x + OFFSET, pos.y * fFontHeight + fTop + OFFSET);
 }
 
 
@@ -2202,23 +2211,23 @@
 TermView::GetFrameSize(float *width, float *height)
 {
 	if (width != NULL)
-		*width = fTermColumns * fFontWidth;
+		*width = 2 * OFFSET + fTermColumns * fFontWidth;
 	
 	if (height == NULL)
 		return;
 	
 	if (!fTop) {
-		*height = fTermRows * fFontHeight;
+		*height = 2 * OFFSET + fTermRows * fFontHeight;
 		return;
 	}
 	
 	if (fTop - fTermRows * fFontHeight > fScrBufSize * fFontHeight) {
 		
-		*height = fScrBufSize * fFontHeight;
+		*height = fScrBufSize * fFontHeight + 2 * OFFSET;
 		return;
 	}
 	
-	*height = fTop + fTermRows * fFontHeight;
+	*height = OFFSET + fTop + fTermRows * fFontHeight;
 }
 
 
@@ -2373,8 +2382,10 @@
 inline void
 TermView::_Redraw(int x1, int y1, int x2, int y2)
 {
-	BRect rect(x1 * fFontWidth, y1 * fFontHeight,
-		(x2 + 1) * fFontWidth -1, (y2 + 1) * fFontHeight -1);
+	BRect rect(x1 * fFontWidth + OFFSET,
+	    y1 * fFontHeight + OFFSET,
+	    (x2 + 1) * fFontWidth + OFFSET - 1,
+	    (y2 + 1) * fFontHeight -1 + OFFSET);
 
 	if (LockLooper()) {
 		Invalidate(rect);
