[Scummvm-cvs-logs] CVS: scummvm/gui editable.cpp,1.3,1.4

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Mon May 16 23:20:32 CEST 2005


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25936

Modified Files:
	editable.cpp 
Log Message:
Fixed caret regression in editable text fields.


Index: editable.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/editable.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- editable.cpp	16 May 2005 13:43:31 -0000	1.3
+++ editable.cpp	17 May 2005 06:19:11 -0000	1.4
@@ -35,7 +35,7 @@
 
 	_editScrollOffset = 0;
 
-	_font = &(g_gui.getFont());	// Most widgets will probably set this to something else.
+	_font = &g_gui.getFont();	// Most widgets will probably set this to something else.
 }
 
 EditableWidget::~EditableWidget() {
@@ -148,18 +148,18 @@
 
 	int16 color = (erase ^ _caretInverse) ? g_gui._bgcolor : g_gui._textcolorhi;
 	int x = editRect.left;
-	int y = editRect.top;
+	int y = editRect.top + 1;
 
 	x += getCaretOffset();
 
-	if (y < 0 || y + editRect.height() >= _h)
+	if (y < 0 || y + editRect.height() - 2 >= _h)
 		return;
 	
 	x += getAbsX();
 	y += getAbsY();
 
-	g_gui.vLine(x, y, y + editRect.height(), color);
-	g_gui.addDirtyRect(x, y, 2, editRect.height());
+	g_gui.vLine(x, y, y + editRect.height() - 2, color);
+	g_gui.addDirtyRect(x, y, 2, editRect.height() - 2);
 
 	_caretVisible = !erase;
 }





More information about the Scummvm-git-logs mailing list