MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / StartClippingCursor

Method StartClippingCursor

Source/Engine/Platform/SDL/SDLWindow.cpp:913–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

911}
912
913void SDLWindow::StartClippingCursor(const Rectangle& bounds)
914{
915 if (!IsFocused())
916 return;
917
918 // The cursor is not fully constrained when positioned outside the clip region
919 SetMousePosition(bounds.GetCenter());
920
921 _isClippingCursor = true;
922 SDL_Rect rect{ (int)bounds.GetX(), (int)bounds.GetY(), (int)bounds.GetWidth(), (int)bounds.GetHeight() };
923 SDL_SetWindowMouseRect(_window, &rect);
924 _clipCursorRect = bounds;
925}
926
927void SDLWindow::EndClippingCursor()
928{

Callers 1

SetCursorLockMethod · 0.45

Calls 5

IsFocusedFunction · 0.85
GetXMethod · 0.80
GetYMethod · 0.80
GetWidthMethod · 0.80
GetHeightMethod · 0.45

Tested by

no test coverage detected