From: martin-s Date: Wed, 2 Sep 2009 09:01:57 +0000 (+0000) Subject: Fix:graphics_win32:Corrected rectangle drawing and hotspot calculation X-Git-Tag: navit-0.5.0.5194svn~2643 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14892158b872d188763f3f850421d6a174f29fe2;p=profile%2Fivi%2Fnavit.git Fix:graphics_win32:Corrected rectangle drawing and hotspot calculation git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2548 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/graphics/win32/graphics_win32.c b/navit/navit/graphics/win32/graphics_win32.c index 82c83cb..c630bd0 100644 --- a/navit/navit/graphics/win32/graphics_win32.c +++ b/navit/navit/graphics/win32/graphics_win32.c @@ -632,7 +632,7 @@ static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc SelectObject( gr->hMemDC, hbrush ); SetBkColor( gr->hMemDC, gc->bg_color ); - Rectangle(gr->hMemDC, p->x, p->y, w, h); + Rectangle(gr->hMemDC, p->x, p->y, p->x+w, p->y+h); DeleteObject( hpen ); DeleteObject( hbrush ); @@ -687,10 +687,12 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) if ( gr->hMemDC ) { dbg(0, "Erase dc: %x, w: %d, h: %d, bg_color: %x\n", gr, gr->width, gr->height, gr->bg_color); +#if 0 RECT rcClient = { 0, 0, gr->width, gr->height}; HBRUSH bgBrush = CreateSolidBrush( gr->bg_color ); FillRect( gr->hMemDC, &rcClient, bgBrush ); DeleteObject( bgBrush ); +#endif if ( gr->hPrebuildDC ) { DeleteBitmap(gr->hPrebuildBitmap); @@ -1133,8 +1135,8 @@ pngdecode(char *name, struct graphics_image_priv *img) if (png_pixels != (unsigned char*) NULL) free (png_pixels); #endif - img->hot.x=img->width/2; - img->hot.y=img->height/2; + img->hot.x=img->width/2-1; + img->hot.y=img->height/2-1; dbg(0,"ok\n"); fclose(png_file); return TRUE;