mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Fix mysterious Y offset in input coordinates
This commit is contained in:
parent
a191915b9d
commit
0eeaec548e
@ -283,11 +283,8 @@ bool MoonlightInstance::HandleInputEvent(const pp::InputEvent& event) {
|
|||||||
sqrt(pow(m_LastTouchUpPoint.x() - touchPoint.x(), 2) +
|
sqrt(pow(m_LastTouchUpPoint.x() - touchPoint.x(), 2) +
|
||||||
pow(m_LastTouchUpPoint.y() - touchPoint.y(), 2)) > TOUCH_DEAD_ZONE_RADIUS) {
|
pow(m_LastTouchUpPoint.y() - touchPoint.y(), 2)) > TOUCH_DEAD_ZONE_RADIUS) {
|
||||||
// Scale the touch coordinates to the video rect
|
// Scale the touch coordinates to the video rect
|
||||||
//
|
|
||||||
// For some reason, the x coordinate is already relative to the plugin rect,
|
|
||||||
// while the y coordinate is not. No clue why that is the case but oh well...
|
|
||||||
short x = MIN(MAX(touchPoint.x(), 0), m_PluginRect.width());
|
short x = MIN(MAX(touchPoint.x(), 0), m_PluginRect.width());
|
||||||
short y = MIN(MAX(touchPoint.y() - m_PluginRect.y(), 0), m_PluginRect.height());
|
short y = MIN(MAX(touchPoint.y(), 0), m_PluginRect.height());
|
||||||
|
|
||||||
// Update the mouse position prior to sending the button down
|
// Update the mouse position prior to sending the button down
|
||||||
LiSendMousePositionEvent(x, y, m_PluginRect.width(), m_PluginRect.height());
|
LiSendMousePositionEvent(x, y, m_PluginRect.width(), m_PluginRect.height());
|
||||||
|
@ -741,7 +741,7 @@ function fullscreenNaclModule() {
|
|||||||
var module = $("#nacl_module")[0];
|
var module = $("#nacl_module")[0];
|
||||||
module.width = zoom * streamWidth;
|
module.width = zoom * streamWidth;
|
||||||
module.height = zoom * streamHeight;
|
module.height = zoom * streamHeight;
|
||||||
module.style.paddingTop = ((screenHeight - module.height) / 2) + "px";
|
module.style.marginTop = ((screenHeight - module.height) / 2) + "px";
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopGameWithConfirmation() {
|
function stopGameWithConfirmation() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user