From: Timothy W. <tw...@us...> - 2005-05-27 16:22:34
|
If you absolutely MUST have a magic constant in there, at least make it obvious what it's doing, e.g. static final int XP_MENU_DEFAULT_BORDER_WIDTH = 2; So whatever the fudge factor is fudging about, please identify it. Note also that menu sizes are variable based on system settings, which makes it all the more important to indicate in what circumstances your fudge is being applied. On May 27, 2005, at 11:39 AM, Joerg Weingarten wrote: > > No it doesn't work. File | New works but File | New | Other does not. > This > is because you might a slight mistake in what you pass into the new > 'translateRectangleHack' method. Here the diff that will work. > > > RCS file: > /cvsroot/abbot/abbot.swt/src/abbot/swt/SWTWorkarounds.java,v > retrieving revision 1.14 > diff -r1.14 SWTWorkarounds.java > 178,179c178,179 > < int x = rect2.left - rect1.left + 2; > < int y = rect2.top - rect1.top + 2; > --- > > int x = rect2.left - (rect1.left + 2); > > int y = rect2.top - (rect1.top + 2); > 184c184 > < new Rectangle (x, y, width, height), > rect2.left, rect2.top); > --- > > new Rectangle (x, y, width, height), > rect1.left + 2, rect1.top + 2); > > I think this will explain to you why your tests sometimes fail. The > 'Other' > clicked won't work because the position is wrong. > |