mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2025-01-03 16:11:49 +01:00
Fix 3DS mouse coords
This commit is contained in:
parent
cb0756d819
commit
d9965f33df
@ -59,7 +59,15 @@ void setClipboardText (void *const userData_, char const *const text_)
|
||||
/// \param io_ ImGui IO
|
||||
void updateTouch (ImGuiIO &io_)
|
||||
{
|
||||
// check if touchpad was touched
|
||||
// check if touchpad was released
|
||||
if (hidKeysUp () & KEY_TOUCH)
|
||||
{
|
||||
// keep mouse position for one frame for release event
|
||||
io_.MouseDown[0] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// check if touchpad is touched
|
||||
if (!(hidKeysHeld () & KEY_TOUCH))
|
||||
{
|
||||
// set mouse cursor off-screen
|
||||
@ -73,7 +81,7 @@ void updateTouch (ImGuiIO &io_)
|
||||
hidTouchRead (&pos);
|
||||
|
||||
// transform to bottom-screen space
|
||||
io_.MousePos = ImVec2 ((pos.px + 40.0f) * 2.0f, (pos.py + 240.0f) * 2.0f);
|
||||
io_.MousePos = ImVec2 (pos.px + 40.0f, pos.py + 240.0f);
|
||||
io_.MouseDown[0] = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user