mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 10:36:44 +00:00
Cleanup
This commit is contained in:
parent
2e4d73e608
commit
39e17e6ace
1 changed files with 7 additions and 4 deletions
|
@ -92,18 +92,21 @@ public class InputManager
|
|||
return;
|
||||
|
||||
var rawPosition = state.Position;
|
||||
var pos = new Point((int)(rawPosition.X / WindowScale), (int)(rawPosition.Y / WindowScale));
|
||||
var pos = new Point((int)(rawPosition.X / WindowScale), (int)(rawPosition.Y / WindowScale)) + new Point(1, 1);
|
||||
|
||||
if (pos.X < 0 || pos.Y < 0 || pos.X >= Texture.Width || pos.Y >= Texture.Height)
|
||||
if (pos.X < 1 || pos.Y < 1 || pos.X > Texture.Width || pos.Y > Texture.Height)
|
||||
return;
|
||||
|
||||
if (pos != mousePosition)
|
||||
{
|
||||
mousePosition = pos + new Point(1, 1);
|
||||
mousePosition = pos;
|
||||
_eventEmitter.RaiseMouseMove(new()
|
||||
{
|
||||
Position = mousePosition,
|
||||
PressedButtons = mouseButtonStates.Where(q => q.Value == ButtonState.Pressed).Select(q => (int)q.Key).ToArray()
|
||||
PressedButtons = mouseButtonStates
|
||||
.Where(q => q.Value == ButtonState.Pressed)
|
||||
.Select(q => (int)q.Key)
|
||||
.ToArray()
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue