struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
int font_width = getFontWidth(font_nr);
int font_height = getFontHeight(font_nr);
+ int border_1 = gfx.sx + gfx.sxsize;
+ int border_2 = gfx.dx + gfx.dxsize;
Bitmap *src_bitmap;
int src_x, src_y;
+ int dst_x_start = dst_x;
char *text_ptr = text;
if (font->bitmap == NULL)
getFontCharSource(font_nr, c, &src_bitmap, &src_x, &src_y);
+ /* make sure that text does not run off the screen at the right side */
+ if ((dst_x_start < border_1 && dst_x + font_width > border_1) ||
+ (dst_x_start < border_2 && dst_x + font_width > border_2))
+ break;
+
if (mask_mode == BLIT_INVERSE) /* special mode for text gadgets */
{
/* first step: draw solid colored rectangle (use "cursor" character) */