|
From: <has...@us...> - 2006-04-20 08:42:33
|
Revision: 1315 Author: hasseily Date: 2006-04-20 01:42:08 -0700 (Thu, 20 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1315&view=rev Log Message: ----------- Hack to fix the icons being displayed shifted on Intel macs. Modified Paths: -------------- Frontier/trunk/Common/source/icon.c Frontier/trunk/Common/source/opicons.c Modified: Frontier/trunk/Common/source/icon.c =================================================================== --- Frontier/trunk/Common/source/icon.c 2006-04-19 18:50:44 UTC (rev 1314) +++ Frontier/trunk/Common/source/icon.c 2006-04-20 08:42:08 UTC (rev 1315) @@ -41,6 +41,8 @@ #include "resources.h" /*7.0b9 PBS*/ #include "launch.h" /*7.0b9 PBS*/ +#include "byteorder.h" + /* #define macicon 128 #define bugicon 129 @@ -82,9 +84,18 @@ OSErr ec; CIconHandle hcicon; Handle hicon; + Rect rlocal = *r; - ec = PlotIconID (r, align, transform, resid); +#ifdef SWAP_BYTE_ORDER + /* For some unknown reason the Intel OS X builds shift the icon displays */ + rlocal.top += 3; + rlocal.bottom += 3; + rlocal.left += 6; + rlocal.right += 6; +#endif + ec = PlotIconID (&rlocal, align, transform, resid); + if (ec == noErr) return (true); @@ -92,7 +103,7 @@ if (hcicon != nil) { - PlotCIcon (r, hcicon); + PlotCIcon (&rlocal, hcicon); DisposeCIcon (hcicon); @@ -103,7 +114,7 @@ if (hicon != nil) { - PlotIcon (r, hicon); + PlotIcon (&rlocal, hicon); /*ReleaseResource (hicon);*/ /*dmb 1.0b21 - don't need to*/ Modified: Frontier/trunk/Common/source/opicons.c =================================================================== --- Frontier/trunk/Common/source/opicons.c 2006-04-19 18:50:44 UTC (rev 1314) +++ Frontier/trunk/Common/source/opicons.c 2006-04-20 08:42:08 UTC (rev 1315) @@ -193,16 +193,16 @@ boolean opdefaultgeticonrect (hdlheadrecord hnode, const Rect *linerect, Rect *iconrect) { hdloutlinerecord ho = outlinedata; - Rect r = *linerect; - Rect rcontains; + Rect r; + Rect rcontains = *linerect; - r.bottom = r.top + (**ho).iconheight; + rcontains.bottom = rcontains.top + (**ho).iconheight; - r.left += opnodeindent (hnode); + rcontains.left += opnodeindent (hnode); - r.right = r.left + (**ho).iconwidth; + rcontains.right = rcontains.left + (**ho).iconwidth; - rcontains = r; + r = rcontains; if (opisfatheadlines (ho)) rcontains.bottom = rcontains.top + textvertinset + (**ho).defaultlineheight + textvertinset; @@ -212,7 +212,7 @@ centerrect (&r, rcontains); /*center it vertically within the linerect*/ *iconrect = r; - + return (true); } /*opdefaultgeticonrect*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |