From 68466df8a27383717d2e29ae12a6c8e0e08a4922 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Tue, 3 Jan 2012 23:29:25 +0000 Subject: Fix clipping and only apply color conversion for hicolor systems. svn path=/trunk/netsurf/; revision=13372 --- atari/plot/font_freetype.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'atari/plot') diff --git a/atari/plot/font_freetype.c b/atari/plot/font_freetype.c index c328a47fa..3bf8e3428 100755 --- a/atari/plot/font_freetype.c +++ b/atari/plot/font_freetype.c @@ -386,8 +386,8 @@ static void draw_glyph8(FONT_PLOTTER self, GRECT * loc, uint8_t * pixdata, int p clip.g_x = self->plotter->clipping.x0; clip.g_y = self->plotter->clipping.y0; - clip.g_w = self->plotter->clipping.x1 - self->plotter->clipping.x0; - clip.g_h = self->plotter->clipping.y1 - self->plotter->clipping.y0; + clip.g_w = (self->plotter->clipping.x1 - self->plotter->clipping.x0)+1; + clip.g_h = (self->plotter->clipping.y1 - self->plotter->clipping.y0)+1; if( !rc_intersect( &clip, loc ) ){ return; @@ -434,8 +434,8 @@ static void draw_glyph1(FONT_PLOTTER self, GRECT * loc, uint8_t * pixdata, int p clip.g_x = self->plotter->clipping.x0; clip.g_y = self->plotter->clipping.y0; - clip.g_w = self->plotter->clipping.x1 - self->plotter->clipping.x0; - clip.g_h = self->plotter->clipping.y1 - self->plotter->clipping.y0; + clip.g_w = (self->plotter->clipping.x1 - self->plotter->clipping.x0)+1; + clip.g_h = (self->plotter->clipping.y1 - self->plotter->clipping.y0)+1; if( !rc_intersect( &clip, loc ) ){ return; @@ -503,7 +503,8 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng uint32_t c = fstyle->foreground ; /* in -> BGR */ /* out -> ARGB */ - c = ABGR_TO_RGB(c); + if( app.nplanes > 8 ) + c = ABGR_TO_RGB(c); while (nxtchr < length) { ucs4 = utf8_to_ucs4(text + nxtchr, length - nxtchr); @@ -526,7 +527,7 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng &loc, bglyph->bitmap.buffer, bglyph->bitmap.pitch, - fstyle->foreground + c ); } } -- cgit v1.2.3