Fix the double offset of inputline text.

This commit is contained in:
Bill Currie 2011-03-24 08:50:32 +09:00
parent e878ace83b
commit 1822290b1a
3 changed files with 6 additions and 10 deletions

View file

@ -66,10 +66,9 @@ static __attribute__ ((used)) const char rcsid[] =
#include "compat.h" #include "compat.h"
// XXX check InputLine.h in ruamoko/include // XXX check InputLine.h in ruamoko/include/gui
typedef struct { typedef struct {
int x, y; int x, y;
int xbase, ybase;
int cursor; int cursor;
} il_data_t; } il_data_t;
@ -572,8 +571,7 @@ void
C_DrawInputLine (inputline_t *il) C_DrawInputLine (inputline_t *il)
{ {
il_data_t *data = il->user_data; il_data_t *data = il->user_data;
DrawInputLine (data->xbase + data->x, data->ybase + data->y, data->cursor, DrawInputLine (data->x, data->y, data->cursor, il);
il);
} }
static void static void

View file

@ -17,9 +17,8 @@ string (inputline_t il) InputLine_GetText = #0;
- (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char - (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char
{ {
self = [super initWithComponents:aRect.origin.x :aRect.origin.y :aRect.size.width * 8 :8]; self = [super initWithComponents:aRect.origin.x :aRect.origin.y :aRect.size.width * 8 :8];
control.x = xpos; control.x = xabs;
control.y = ypos; control.y = yabs;
control.xbase = control.ybase = 0;
control.cursor = NO; control.cursor = NO;
il = InputLine_Create (aRect.size.height, aRect.size.width, char); 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 - (void) setBasePosFromView: (View *) view
{ {
[super setBasePosFromView: view]; [super setBasePosFromView: view];
control.xbase = xabs; control.x = xabs;
control.ybase = yabs; control.y = yabs;
} }
- (void) setWidth: (integer)width - (void) setWidth: (integer)width

View file

@ -18,7 +18,6 @@ typedef struct _inputline_t *inputline_t;
struct il_data_t { struct il_data_t {
integer x, y; integer x, y;
integer xbase, ybase;
BOOL cursor; BOOL cursor;
}; };