summaryrefslogtreecommitdiff
path: root/atari
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2012-08-26 21:36:16 +0200
committerOle Loots <ole@monochrom.net>2012-08-26 21:36:16 +0200
commitb58825dcf75473a5ce13b7f405a8ca3c598fd1cc (patch)
treed42c441a3735fd68349f62908a7bbd7837bc78c7 /atari
parentd3a051872613eed7bac451642d8b302c963c57f0 (diff)
downloadnetsurf-b58825dcf75473a5ce13b7f405a8ca3c598fd1cc.tar.gz
netsurf-b58825dcf75473a5ce13b7f405a8ca3c598fd1cc.tar.bz2
Center favicon, don't stretch.
Diffstat (limited to 'atari')
-rwxr-xr-xatari/browser_win.c18
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);
}