mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Fix in positions of term and mouse events
This commit is contained in:
parent
0f4acff113
commit
bd146b465a
2 changed files with 8 additions and 8 deletions
|
@ -99,12 +99,12 @@ public class InputManager
|
||||||
|
|
||||||
if (pos != mousePosition)
|
if (pos != mousePosition)
|
||||||
{
|
{
|
||||||
|
mousePosition = pos + new Point(1, 1);
|
||||||
_eventEmitter.RaiseMouseMove(new()
|
_eventEmitter.RaiseMouseMove(new()
|
||||||
{
|
{
|
||||||
Position = pos,
|
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()
|
||||||
});
|
});
|
||||||
mousePosition = pos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int vValue = 0;
|
int vValue = 0;
|
||||||
|
|
|
@ -453,8 +453,8 @@ internal class Term : IPlugin
|
||||||
var x = (int)L.CheckNumber(1);
|
var x = (int)L.CheckNumber(1);
|
||||||
var y = (int)L.CheckNumber(2);
|
var y = (int)L.CheckNumber(2);
|
||||||
|
|
||||||
L.PushInteger(x * CharWidth);
|
L.PushInteger(x * CharWidth - CharWidth + 1);
|
||||||
L.PushInteger(y * CharHeight);
|
L.PushInteger(y * CharHeight - CharHeight + 1);
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -463,11 +463,11 @@ internal class Term : IPlugin
|
||||||
{
|
{
|
||||||
var L = Lua.FromIntPtr(state);
|
var L = Lua.FromIntPtr(state);
|
||||||
|
|
||||||
var x = (int)L.CheckNumber(1);
|
var x = (int)L.CheckNumber(1) - 1;
|
||||||
var y = (int)L.CheckNumber(2);
|
var y = (int)L.CheckNumber(2) - 1;
|
||||||
|
|
||||||
L.PushInteger(x / CharWidth);
|
L.PushInteger(x / CharWidth + 1);
|
||||||
L.PushInteger(y / CharHeight);
|
L.PushInteger(y / CharHeight + 1);
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue