From 1822290b1ad1fab191a38165b774de319353257c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 24 Mar 2011 08:50:32 +0900 Subject: [PATCH] Fix the double offset of inputline text. --- libs/console/client.c | 6 ++---- ruamoko/gui/InputLine.r | 9 ++++----- ruamoko/include/gui/InputLine.h | 1 - 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/libs/console/client.c b/libs/console/client.c index 5e3ff44a3..4e1c06c34 100644 --- a/libs/console/client.c +++ b/libs/console/client.c @@ -66,10 +66,9 @@ static __attribute__ ((used)) const char rcsid[] = #include "compat.h" -// XXX check InputLine.h in ruamoko/include +// XXX check InputLine.h in ruamoko/include/gui typedef struct { int x, y; - int xbase, ybase; int cursor; } il_data_t; @@ -572,8 +571,7 @@ void C_DrawInputLine (inputline_t *il) { il_data_t *data = il->user_data; - DrawInputLine (data->xbase + data->x, data->ybase + data->y, data->cursor, - il); + DrawInputLine (data->x, data->y, data->cursor, il); } static void diff --git a/ruamoko/gui/InputLine.r b/ruamoko/gui/InputLine.r index db5322584..84d2ab10d 100644 --- a/ruamoko/gui/InputLine.r +++ b/ruamoko/gui/InputLine.r @@ -17,9 +17,8 @@ string (inputline_t il) InputLine_GetText = #0; - (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char { self = [super initWithComponents:aRect.origin.x :aRect.origin.y :aRect.size.width * 8 :8]; - control.x = xpos; - control.y = ypos; - control.xbase = control.ybase = 0; + control.x = xabs; + control.y = yabs; control.cursor = NO; il = InputLine_Create (aRect.size.height, aRect.size.width, char); @@ -37,8 +36,8 @@ string (inputline_t il) InputLine_GetText = #0; - (void) setBasePosFromView: (View *) view { [super setBasePosFromView: view]; - control.xbase = xabs; - control.ybase = yabs; + control.x = xabs; + control.y = yabs; } - (void) setWidth: (integer)width diff --git a/ruamoko/include/gui/InputLine.h b/ruamoko/include/gui/InputLine.h index f75bdfe68..ad0b0118c 100644 --- a/ruamoko/include/gui/InputLine.h +++ b/ruamoko/include/gui/InputLine.h @@ -18,7 +18,6 @@ typedef struct _inputline_t *inputline_t; struct il_data_t { integer x, y; - integer xbase, ybase; BOOL cursor; };