r5339 vince - in /branches/vince/netsurf-fb/framebuffer: fb_16bpp_plotters.c fb_32bpp_plotters.c

netsurf at semichrome.net netsurf at semichrome.net
Tue Sep 16 00:07:57 BST 2008


Author: vince
Date: Mon Sep 15 18:07:57 2008
New Revision: 5339

URL: http://source.netsurf-browser.org?rev=5339&view=rev
Log:
possibly fix text clipping issue

Modified:
    branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c
    branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c

Modified: branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c?rev=5339&r1=5338&r2=5339&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_16bpp_plotters.c Mon Sep 15 18:07:57 2008
@@ -222,18 +222,16 @@
 	char *buffer = NULL;
 
         /* y is given to the fonts baseline we need it to the fonts top */
-        y-=(fb_font->height * 75)/100;
+        y-=((fb_font->height * 75)/100);
+
+        y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make
+                  it work since fb coords are the top-left of pixels 
+              */
 
         if (y + fb_font->height > fb_plot_ctx.y1)
                 return true;
 
-        if (x > fb_plot_ctx.x1)
-                return true;
-
         if (y < fb_plot_ctx.y0)
-                return true;
-
-        if (x < fb_plot_ctx.x0)
                 return true;
 
 	utf8_to_local_encoding(text, length, &buffer);
@@ -255,8 +253,14 @@
         /*LOG(("x %d, y %d, style %p, txt %.*s , len %d, bg 0x%lx, fg 0x%lx",
           x,y,style,length,text,length,bg,c));*/
 
-        for (chr=0; chr < length; chr++) {
-                pvideo = fb_16bpp_get_xy_loc(x + (chr * (fb_font->width)), y, current_window);
+        for (chr = 0; chr < length; chr++, x += fb_font->width) {
+                if ((x + fb_font->width) > fb_plot_ctx.x1)
+                        break;
+
+                if (x < fb_plot_ctx.x0) 
+                        continue;
+
+                pvideo = fb_16bpp_get_xy_loc(x, y, current_window);
 
                 /* move our font-data to the correct position */
                 font_data = fb_font->data + (buffer[chr] * fb_font->height);
@@ -270,7 +274,6 @@
                         }
                         pvideo += (framebuffer->linelen >> 1);
                 }
-
         }
 
 	free(buffer);

Modified: branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c?rev=5339&r1=5338&r2=5339&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_32bpp_plotters.c Mon Sep 15 18:07:57 2008
@@ -120,6 +120,10 @@
         /* y is given to the fonts baseline we need it to the fonts top */
         y-=(fb_font->height * 75)/100;
 
+        y+=1; /* he coord is the bottom-left of the pixels offset by 1 to make
+                  it work since fb coords are the top-left of pixels 
+              */
+
         if (y + fb_font->height > fb_plot_ctx.y1)
                 return true;
 




More information about the netsurf-commits mailing list