-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix placing objects via touch in editor not working sometimes #30411
base: master
Are you sure you want to change the base?
Conversation
…input More specifically, this fixes placement blueprints not beginning placement when using touch input while the cursor was previously outside compose area, due to the placement blueprint not existing (removed from the scene by `ComposeBlueprintContainer`).
@@ -127,6 +129,16 @@ protected override bool Handle(UIEvent e) | |||
} | |||
} | |||
|
|||
protected override void PopIn() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want a fade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought it may be a nice touch, no problem.
I think the direction seems okay. Will need some conflict resolution on tests (need to be moved to new class). |
osu.Game/Screens/Edit/Compose/Components/ComposeBlueprintContainer.cs
Outdated
Show resolved
Hide resolved
In initial testing I can't find any edge cases that don't match previous behaviour. But reviewing this change is a bit arduous due to the amount of weird logic surrounding the placement object (and the change doesn't simplify but instead adds more new state). Will need some time to work through this. |
Placing objects in editor requires the presence of a
PlacementBlueprint
that responds to the input of the user placing the object. But placement blueprints are programmed to be removed when the user's cursor is outside the compose area.Similar to the symptoms in #30263, in the case of touch input, if the current position of the cursor (led by where the user has tapped the screen last time) is currently outside the compose area, then if the user tries to tap on the compose screen to place an object, nothing happens because there's no
PlacementBlueprint
present at the point of the user tapping the compose area.Unlike #30263, this cannot be resolved by responding to mouse movement events and create a
PlacementBlueprint
right before the subsequent mouse click event is raised, because adding a drawable in the scene requires waiting a full update frame cycle in order for the drawable to become alive (which is a prerequisite for the drawable to be considered in the input queue).Instead, this PR resolves the issue by making placement blueprints always exist, and change their visibility state instead. This required a minor refactor around the
IPlacementHandler
interface to better work with the new behaviour.ScreenRecording_10-23-2024.16-55-59_1.MP4