diff options
-rwxr-xr-x | atari/browser_win.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/atari/browser_win.c b/atari/browser_win.c index 98870838e..29e78caf9 100755 --- a/atari/browser_win.c +++ b/atari/browser_win.c @@ -481,14 +481,17 @@ static void __CDECL evnt_window_iconify( WINDOW *win, short buff[8], void * data input_window = NULL;
}
}
-
+ +/** + * Redraw the favicon +*/
static void __CDECL evnt_window_icondraw( WINDOW *win, short buff[8], void * data )
{
short x,y,w,h;
struct gui_window * gw = (struct gui_window*)data;
WindClear( win);
- WindGet( win, WF_WORKXYWH, &x, &y, &w, &h);
+ WindGet( win, WF_WORKXYWH, &x, &y, &w, &h); if( gw->icon == NULL ) {
OBJECT * tree;
RsrcGaddr( h_gem_rsrc, R_TREE, ICONIFY , &tree );
@@ -497,9 +500,14 @@ static void __CDECL evnt_window_icondraw( WINDOW *win, short buff[8], void * dat tree->ob_width = w;
tree->ob_height = h;
mt_objc_draw( tree, 0, 8, buff[4], buff[5], buff[6], buff[7], app.aes_global );
- } else {
- struct rect clip = { 0,0,w,h };
- plot_set_dimensions( x,y,w,h );
+ } else { + struct rect clip = { 0,0,w,h }; + int xoff=0; + if (w > h) { + xoff = ((w-h)/2); + w = h; + }
+ plot_set_dimensions( x+xoff,y,w,h );
plot_clip(&clip);
atari_plotters.bitmap(0, 0, w, h, gw->icon, 0xffffff, 0);
}
|