mouse fix
This commit is contained in:
parent
ef199b180e
commit
4cf8c61013
1 changed files with 3 additions and 3 deletions
|
|
@ -314,7 +314,7 @@ void Device::pointer_handle_button(void* data, wl_pointer* pointer, std::uint32_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Device::focusedWindow->mouseRightHeld = true;
|
Device::focusedWindow->mouseRightHeld = false;
|
||||||
Device::focusedWindow->onMouseRightRelease.Invoke();
|
Device::focusedWindow->onMouseRightRelease.Invoke();
|
||||||
for(MouseElement* element : Device::focusedWindow->mouseElements) {
|
for(MouseElement* element : Device::focusedWindow->mouseElements) {
|
||||||
if(element) {
|
if(element) {
|
||||||
|
|
@ -332,9 +332,9 @@ void Device::pointer_handle_button(void* data, wl_pointer* pointer, std::uint32_
|
||||||
|
|
||||||
void Device::PointerListenerHandleMotion(void* data, wl_pointer* wl_pointer, std::uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
void Device::PointerListenerHandleMotion(void* data, wl_pointer* wl_pointer, std::uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
||||||
Vector<float, 2> pos(wl_fixed_to_double(surface_x), wl_fixed_to_double(surface_y));
|
Vector<float, 2> pos(wl_fixed_to_double(surface_x), wl_fixed_to_double(surface_y));
|
||||||
Device::focusedWindow->lastMousePos = Device::focusedWindow->currentMousePos;
|
//Device::focusedWindow->lastMousePos = Device::focusedWindow->currentMousePos;
|
||||||
Device::focusedWindow->currentMousePos = pos * Device::focusedWindow->scale;
|
Device::focusedWindow->currentMousePos = pos * Device::focusedWindow->scale;
|
||||||
Device::focusedWindow->mouseDelta = {Device::focusedWindow->currentMousePos.x-Device::focusedWindow->lastMousePos.x, Device::focusedWindow->currentMousePos.y-Device::focusedWindow->lastMousePos.y};
|
//Device::focusedWindow->mouseDelta = {Device::focusedWindow->currentMousePos.x-Device::focusedWindow->lastMousePos.x, Device::focusedWindow->currentMousePos.y-Device::focusedWindow->lastMousePos.y};
|
||||||
Device::focusedWindow->onMouseMove.Invoke();
|
Device::focusedWindow->onMouseMove.Invoke();
|
||||||
for(MouseElement* element : Device::focusedWindow->mouseElements) {
|
for(MouseElement* element : Device::focusedWindow->mouseElements) {
|
||||||
if(element) {
|
if(element) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue