| 530 | #pragma region Viewport dragging |
| 531 | |
| 532 | static void InputViewportDragBegin(WindowBase& w) |
| 533 | { |
| 534 | w.flags.unset(WindowFlag::scrollingToLocation); |
| 535 | _inputState = InputState::viewportRight; |
| 536 | _dragWidget.windowClassification = w.classification; |
| 537 | _dragWidget.windowNumber = w.number; |
| 538 | _ticksSinceDragStart = gCurrentRealTimeTicks; |
| 539 | auto cursorPosition = ContextGetCursorPosition(); |
| 540 | gInputDragLast = cursorPosition; |
| 541 | if (!Config::Get().general.invertViewportDrag) |
| 542 | { |
| 543 | ContextHideCursor(); |
| 544 | } |
| 545 | |
| 546 | // Only unfollow sprites for the main window or ‘extra viewport’ windows. |
| 547 | // Don’t unfollow for windows where the viewport is always supposed to follow (e.g. Ride, Guest, Staff). |
| 548 | auto mainWindow = WindowGetMain(); |
| 549 | if (&w == mainWindow || w.classification == WindowClass::viewport) |
| 550 | { |
| 551 | WindowUnfollowSprite(w); |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | static void InputViewportDragContinue() |
| 556 | { |
no test coverage detected