X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=gfx%2Ftext.c;fp=gfx%2Ftext.c;h=a9f653c4ad233e10965bfc3d6df20746ae0ce195;hb=0b674e357f620a2e0810cf74f3e66e8072d9bb86;hp=08d3ae6167283343b7d0b4d4b31a7fc60fce1696;hpb=d599db8632e2cd967d7df7507665d723b8f74b4e;p=bertos.git diff --git a/gfx/text.c b/gfx/text.c index 08d3ae61..a9f653c4 100755 --- a/gfx/text.c +++ b/gfx/text.c @@ -15,6 +15,9 @@ /*#* *#* $Log$ + *#* Revision 1.9 2006/04/11 00:08:24 bernie + *#* text_offset(): New function, but I'm not quite confident with the design. + *#* *#* Revision 1.8 2006/03/22 09:50:37 bernie *#* Use the same format for fonts and rasters. *#* @@ -107,6 +110,14 @@ /*! ANSI escape sequences flag: true for ESC state on */ static bool ansi_mode = false; +// FIXME: move in bitmap? +static coord_t text_xoff, text_yoff; + +void text_offset(Bitmap *bm, coord_t x, coord_t y) +{ + text_xoff = x; + text_yoff = y; +} /*! * Move (imaginary) cursor to column and row specified. @@ -119,8 +130,8 @@ void text_moveto(struct Bitmap *bm, int row, int col) ASSERT(row >= 0); ASSERT(row < bm->height / bm->font->height); - bm->penX = col * bm->font->width; - bm->penY = row * bm->font->height; + bm->penX = col * bm->font->width + text_xoff; + bm->penY = row * bm->font->height + text_yoff; }