MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / update_safe_area

Method update_safe_area

src/InputManager.cpp:872–882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872void InputManager::update_safe_area() {
873 SDL_Rect safeArea;
874 if(SDL_GetWindowSafeArea(main.window.sdlWindow, &safeArea))
875 main.window.safeArea = SCollision::AABB<float>({safeArea.x, safeArea.y}, {safeArea.x + safeArea.w, safeArea.y + safeArea.h});
876 else
877 main.window.safeArea = SCollision::AABB<float>({0, 0}, {main.window.size.x(), main.window.size.y()});
878
879 std::scoped_lock a{safeAreaWithoutIMEMutex};
880 if(safeAreaWithoutIME.has_value() && excludeIMEFromSafeArea)
881 main.window.safeArea = safeAreaWithoutIME.value();
882}
883
884void InputManager::backend_window_resize_update() {
885 update_safe_area();

Callers 1

initialize_sdlFunction · 0.80

Calls 3

xMethod · 0.45
yMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected