| 866 | } |
| 867 | |
| 868 | void WindowMoveAndSnap(WindowBase& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity) |
| 869 | { |
| 870 | auto originalPos = w.windowPos; |
| 871 | int32_t minY = gLegacyScene == LegacyScene::titleSequence ? 1 : kTopToolbarHeight + 2; |
| 872 | |
| 873 | newWindowCoords.y = std::clamp(newWindowCoords.y, minY, ContextGetHeight() - 34); |
| 874 | |
| 875 | if (snapProximity > 0) |
| 876 | { |
| 877 | w.windowPos = newWindowCoords; |
| 878 | |
| 879 | SnapRight(w, snapProximity); |
| 880 | SnapBottom(w, snapProximity); |
| 881 | SnapLeft(w, snapProximity); |
| 882 | SnapTop(w, snapProximity); |
| 883 | |
| 884 | if (w.windowPos == originalPos) |
| 885 | return; |
| 886 | |
| 887 | newWindowCoords = w.windowPos; |
| 888 | w.windowPos = originalPos; |
| 889 | } |
| 890 | |
| 891 | WindowSetPosition(w, newWindowCoords); |
| 892 | } |
| 893 | |
| 894 | void WindowMovePosition(WindowBase& w, const ScreenCoordsXY& deltaCoords) |
| 895 | { |
no test coverage detected