Run cursor action pre-draw logic before capturing the object under th…#324
Open
NayiemW wants to merge 1 commit into
Open
Run cursor action pre-draw logic before capturing the object under th…#324NayiemW wants to merge 1 commit into
NayiemW wants to merge 1 commit into
Conversation
…e cursor Since the MapUI/MapView split, the object under the cursor has been passed to the renderer by value before the active cursor action's PreMapDraw ran, but placement previews assign the object-under-cursor property inside PreMapDraw. The property was then reset on the next update, so range indicators never showed while placing buildings such as pillboxes. Invoke PreMapDraw before passing the object to the renderer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the
MapUI/MapViewsplit,TechnoUnderCursorhas been passed intoMapView.Drawbefore the active cursor action’sPreMapDrawlogic runs.This breaks placement range indicators because building placement previews assign
TechnoUnderCursorinsidePreMapDraw. Since the renderer receives the previous value, it does not see the newly assigned object during that frame. The property is then reset during the next update cycle, so range indicators never appear while placing buildings such as pillboxes.Previously, the relevant order was effectively:
After the split, it became:
This change moves the
PreMapDrawinvocation intoMapUI.Draw, beforeTechnoUnderCursoris passed to the renderer.MapView.Drawno longer invokes it a second time.The corrected order is therefore:
PostMapDrawremains in its existing location, so the intended call order around map rendering is preserved while ensuring placement previews can display their range indicators.