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; return;
Rect rect = API.GetControlBounds(carbonWindow.WindowRef); Rect rect = API.GetControlBounds(carbonWindow.WindowRef);
System.Windows.Forms.Form frm = (System.Windows.Forms.Form) ctrl.TopLevelControl;
rect.X = (short)ctrl.Left; System.Drawing.Point loc =
rect.Y = (short)ctrl.Top; 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("Setting buffer_rect for control.");
Debug.Print("MacOS Coordinate Rect: {0}", rect); Debug.Print("MacOS Coordinate Rect: {0}", rect);
@ -219,7 +223,7 @@ namespace OpenTK.Platform.MacOS
if (carbonWindow.IsControl) if (carbonWindow.IsControl)
{ {
IntPtr controlOwner = API.GetControlOwner(carbonWindow.WindowRef); IntPtr controlOwner = API.GetControlOwner(carbonWindow.WindowRef);
windowPort = API.GetWindowPort(controlOwner); windowPort = API.GetWindowPort(controlOwner);
} }
else else