mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-08 12:50:42 +00:00
Fix potential exception that I was ignoring.
This can happen, so we should handle it
This commit is contained in:
parent
794d45fdeb
commit
ba0180ed77
|
@ -54,11 +54,14 @@ namespace OpenTK
|
||||||
}
|
}
|
||||||
|
|
||||||
private int GetYOffset(){
|
private int GetYOffset(){
|
||||||
|
if (control.TopLevelControl != null) {
|
||||||
System.Drawing.Point offset = control.PointToScreen (control.Location);
|
System.Drawing.Point offset = control.PointToScreen (control.Location);
|
||||||
System.Drawing.Point windowOffset = control.TopLevelControl.PointToScreen (System.Drawing.Point.Empty);
|
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.
|
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.TopLevelControl.ClientSize.Height - control.Bottom - relativeY;
|
||||||
}
|
}
|
||||||
|
return control.Location.Y;
|
||||||
|
}
|
||||||
|
|
||||||
#region IGLControl Members
|
#region IGLControl Members
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue