Skip to content

Fix #3133: Right mouse drag no longer works on main viewport#3134

Merged
duncanspumpkin merged 5 commits intoOpenLoco:masterfrom
LeeSpork:viewpor
Jul 3, 2025
Merged

Fix #3133: Right mouse drag no longer works on main viewport#3134
duncanspumpkin merged 5 commits intoOpenLoco:masterfrom
LeeSpork:viewpor

Conversation

@LeeSpork
Copy link
Copy Markdown
Contributor

@LeeSpork LeeSpork commented Jun 30, 2025

I believe the problem was #3122's changes. It changes the behaviour of Window::viewportIsFocusedOnEntity with the intention of allowing passing it a targetEntity value of EntityId::null to check if no entity is being focused. This however does not work: it seems that Window::viewportIsFocusedOnEntity always returns false when used in the main viewport window because its savedView always isEmpty (in this situation, at least).

This pull fixes #3133 by reverting #3122's changes to that function, and instead adding a new function for the purpose of checking if there is no entity being targeted.

LeeSpork added 5 commits July 1, 2025 11:46
I'm realising viewportIsFocusedOnEntity was bending the idea of "functions should do one and only one thing", since "Is there no targeted entity?" is a distinct question from "Is my specific entity being target?" I think. Having the function being able to return true when there is no viewport/saved view feels like the sort of thing that could potentially break an assumption somewhere, or otherwise be confusing
code style sort of change to make it read very slightly easier
@ZehMatt ZehMatt added this to the v25.06+ milestone Jul 1, 2025
@duncanspumpkin duncanspumpkin changed the title Fix #3133 Fix #3133: Right mouse drag no longer works on main viewport Jul 1, 2025
@duncanspumpkin duncanspumpkin merged commit 9133781 into OpenLoco:master Jul 3, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right mouse dragging no longer works on main viewport

3 participants