}
}
+ internal static float Scale = 1.0f;
+
#endregion
#region Public Members
public MouseState GetState()
{
- return state;
+ MouseState scaledState = state;
+ if (Configuration.RunningOnMacOS)
+ {
+ scaledState.X = (int)Math.Round(scaledState.X * Scale);
+ scaledState.Y = (int)Math.Round(scaledState.Y * Scale);
+ }
+ return scaledState;
}
public MouseState GetState(int index)
{
if (index == 0)
- return state;
+ return GetState();
else
return new MouseState();
}
int x, y;
var buttons = SDL.GetMouseState(out x, out y);
+ if (Configuration.RunningOnMacOS)
+ {
+ x = (int)Math.Round(x * Scale);
+ y = (int)Math.Round(y * Scale);
+ }
+
var c = new MouseState();
c.SetIsConnected(true);
c.X = x;
c[MouseButton.Button1] = (buttons & ButtonFlags.X1) != 0;
c[MouseButton.Button2] = (buttons & ButtonFlags.X2) != 0;
- return state;
+ return c;
}
public void SetPosition(double x, double y)
window.OnMouseMove(
(int)Math.Round(ev.X * scale),
(int)Math.Round(ev.Y * scale));
+ Sdl2Mouse.Scale = scale;
}
static void ProcessMouseWheelEvent(Sdl2NativeWindow window, MouseWheelEvent ev)