Merge pull request #553 from VPeruS/interop-macos-set-position
Wrong cast for interop when setting mouse position(MacOS)
This commit is contained in:
commit
4eb02d3012
1 changed files with 12 additions and 2 deletions
|
@ -1048,10 +1048,20 @@ namespace OpenTK.Platform.MacOS
|
|||
|
||||
NSPoint p = new NSPoint();
|
||||
unsafe
|
||||
{
|
||||
if (IntPtr.Size == 8)
|
||||
{
|
||||
p.X.Value = *(IntPtr *)&x;
|
||||
p.Y.Value = *(IntPtr *)&y;
|
||||
}
|
||||
else
|
||||
{
|
||||
float f1 = (float)x;
|
||||
float f2 = (float)y;
|
||||
p.X.Value = *(IntPtr *)&f1;
|
||||
p.Y.Value = *(IntPtr *)&f2;
|
||||
}
|
||||
}
|
||||
|
||||
CG.WarpMouseCursorPosition(p);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue