Skip to content

Commit a01124f

Browse files
committed
fix invalid MousePos when cursor got out of application window while dragging a imgui window
1 parent 61e8710 commit a01124f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/fpimgui_impl_sdlgl2.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ procedure ImGui_ImplSdlGL2_NewFrame(window: PSDL_Window);
200200
// Setup inputs
201201
// (we already got mouse wheel, keyboard keys & characters from SDL_PollEvent())
202202
mouseMask := SDL_GetMouseState(@mx, @my);
203-
if ((SDL_GetWindowFlags(window) and SDL_WINDOW_MOUSE_FOCUS) <> 0) then
203+
if ((SDL_GetWindowFlags(window) and SDL_WINDOW_INPUT_FOCUS) <> 0) then
204204
io^.MousePos := ImVec2Init(mx, my) // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
205205
else
206206
io^.MousePos := ImVec2Init(-FLT_MAX, -FLT_MAX);

0 commit comments

Comments
 (0)