Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update spacing and formatting to match existing style

  • Loading branch information...
commit 0df7c5560912dd2eb3cf91b08fa67756b33135d2 1 parent ba0180e
Paul Kratt authored
View
29 Source/GLControl/CarbonGLControl.cs
@@ -46,22 +46,25 @@ internal CarbonGLControl(GraphicsMode mode, Control owner)
this.mode = mode;
this.control = owner;
- window_info = Utilities.CreateMacOSCarbonWindowInfo(control.Handle, false, true, GetXOffset, GetYOffset);
+ window_info = Utilities.CreateMacOSCarbonWindowInfo(control.Handle, false, true, GetXOffset, GetYOffset);
}
- private int GetXOffset(){
- return control.Location.X;
- }
+ private int GetXOffset()
+ {
+ return control.Location.X;
+ }
- private int GetYOffset(){
- if (control.TopLevelControl != null) {
- System.Drawing.Point offset = control.PointToScreen (control.Location);
- System.Drawing.Point windowOffset = control.TopLevelControl.PointToScreen (System.Drawing.Point.Empty);
- int relativeY = offset.Y - windowOffset.Y; //control.TopLevelControl.Location.Y is not the same as windowOffset.Y for some reason.
- return control.TopLevelControl.ClientSize.Height - control.Bottom - relativeY;
- }
- return control.Location.Y;
- }
+ private int GetYOffset()
+ {
+ if (control.TopLevelControl != null)
+ {
+ System.Drawing.Point offset = control.PointToScreen (control.Location);
+ System.Drawing.Point windowOffset = control.TopLevelControl.PointToScreen (System.Drawing.Point.Empty);
+ int relativeY = offset.Y - windowOffset.Y; //control.TopLevelControl.Location.Y is not the same as windowOffset.Y for some reason.
+ return control.TopLevelControl.ClientSize.Height - control.Bottom - relativeY;
+ }
+ return control.Location.Y;
+ }
#region IGLControl Members
View
38 Source/GLControl/GLControl.cs
@@ -270,27 +270,29 @@ protected override void OnResize(EventArgs e)
return;
}
- if (Configuration.RunningOnMacOS) {
- DelayUpdate delay = PerformContextUpdate;
- BeginInvoke(delay); //Need the native window to resize first otherwise our control will be in the wrong place.
- }
- else if (context != null)
- context.Update (Implementation.WindowInfo);
-
+ if (Configuration.RunningOnMacOS)
+ {
+ DelayUpdate delay = PerformContextUpdate;
+ BeginInvoke(delay); //Need the native window to resize first otherwise our control will be in the wrong place.
+ }
+ else if (context != null)
+ context.Update (Implementation.WindowInfo);
+
base.OnResize(e);
}
- /// <summary>
- /// Needed to delay the invoke on OS X. Also needed because OpenTK is .NET 2, otherwise I'd use an inline Action.
- /// </summary>
- public delegate void DelayUpdate();
- /// <summary>
- /// Execute the delayed context update
- /// </summary>
- public void PerformContextUpdate(){
- if (context != null)
- context.Update (Implementation.WindowInfo);
- }
+ /// <summary>
+ /// Needed to delay the invoke on OS X. Also needed because OpenTK is .NET 2, otherwise I'd use an inline Action.
+ /// </summary>
+ public delegate void DelayUpdate();
+ /// <summary>
+ /// Execute the delayed context update
+ /// </summary>
+ public void PerformContextUpdate()
+ {
+ if (context != null)
+ context.Update (Implementation.WindowInfo);
+ }
/// <summary>
/// Raises the ParentChanged event.
View
7 Source/OpenTK/Platform/MacOS/AglContext.cs
@@ -172,13 +172,6 @@ void SetBufferRect(CarbonWindowInfo carbonWindow)
if (carbonWindow.IsControl == false)
return;
- // Todo: See if there is a way around using WinForms.
- //throw new NotImplementedException();
- /*System.Windows.Forms.Control ctrl = Control.FromHandle(carbonWindow.WindowHandle);
-
- if (ctrl.TopLevelControl == null)
- return;*/
-
Rect rect = API.GetControlBounds(carbonWindow.WindowHandle);
Debug.Print("Setting buffer_rect for control.");
Please sign in to comment.
Something went wrong with that request. Please try again.