Fix AGL buffer rectangle when destination control is inside a container inside a form.

This commit is contained in:
kanato 2009-05-07 16:32:15 +00:00
parent 3c522d26ee
commit bc236a7c0b

View file

@ -179,9 +179,13 @@ namespace OpenTK.Platform.MacOS
return;
Rect rect = API.GetControlBounds(carbonWindow.WindowRef);
System.Windows.Forms.Form frm = (System.Windows.Forms.Form) ctrl.TopLevelControl;
rect.X = (short)ctrl.Left;
rect.Y = (short)ctrl.Top;
System.Drawing.Point loc =
frm.PointToClient(ctrl.PointToScreen(System.Drawing.Point.Empty));
rect.X = (short)loc.X;
rect.Y = (short)loc.Y;
Debug.Print("Setting buffer_rect for control.");
Debug.Print("MacOS Coordinate Rect: {0}", rect);