Skip to content

Commit 504d967

Browse files
ImGui: fixed handling of mouse input on Emscripten
1 parent c5f8453 commit 504d967

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Imgui/src/ImGuiImplEmscripten.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ void ImGuiImplEmscripten::Render(IDeviceContext* pCtx)
9090

9191
bool ImGuiImplEmscripten::OnMouseEvent(int32_t EventType, const EmscriptenMouseEvent* Event)
9292
{
93-
auto DevicePixelRatio = emscripten_get_device_pixel_ratio();
94-
9593
auto& io = ImGui::GetIO();
96-
io.MousePos = ImVec2(Event->targetX * DevicePixelRatio, Event->targetY * DevicePixelRatio);
94+
io.MousePos = ImVec2(Event->targetX, Event->targetY);
9795
io.MouseDown[0] = Event->buttons & 1;
9896
io.MouseDown[1] = Event->buttons & 2;
9997
io.MouseDown[2] = Event->buttons & 4;

0 commit comments

Comments
 (0)