|
From: SourceForge.net <no...@so...> - 2004-03-01 21:47:45
|
Bugs item #907874, was opened at 2004-03-01 21:35 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442052&aid=907874&group_id=45158 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Dair Grant (grantd) Assigned to: Nobody/Anonymous (nobody) Summary: Picking on Windows does not match Mac Initial Comment: Joe Strout wrote: There's a bug with picking in Win32, where in order to get the correct result, you have to adjust the window coordinates passed in by a certain scale factor that varies from machine to machine. My guess is that this relates somehow to the resolution of the screen. Perhaps we're somewhere using pixels where we should be using points, or vice versa. We've found more information about the odd picking bug on Win32. In order to get the pick to work correctly, you have to apply a scaling factor that depends on both the screen size and the view size and position. In RB code, it looks like this: #If TargetWin32 x2 = x * Screen(0).width / Rb3DSpace1.width - Rb3DSpace1.left y2 = y * Screen(0).height / Rb3DSpace1.height - Rb3DSpace1.top #Else x2 = x // All works as expected on the Mac y2 = y #Endif // (and then pass x2, y2 to the picking function) So, for both X and Y, we have to multiply by the ratio of the screen size to view size, and then subtract off the top/left of the view (so that the coordinates are now relative to the view rather than the window). On the Mac none of that is necessary; we just pass in window coordinates and it works. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442052&aid=907874&group_id=45158 |