-
-
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 cursor trail disconnect from cursor when settings or notification overlay is opened #29070
Conversation
- Convert cursor trail coordinates to local space before storing. - Apply necessary transformations to align with other UI elements. - Ensure cursor trail remains connected during UI panel movements.
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.
Looks to work fine
@@ -285,9 +285,11 @@ protected override void Draw(IRenderer renderer) | |||
if (time - part.Time >= 1) | |||
continue; | |||
|
|||
Vector2 screenSpacePos = Source.ToScreenSpace(part.Position); |
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.
This should not be done in the DrawNode.
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.
For those that don't know why, can you provide an explanation of what is wrong and why?
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.
Simply because this is accessing a member which is on the update thread. For instance, this could cause validations which is a recursive query up the scene graph with who knows what effects - the important part is that it's a cross thread access.
The only time you should access "Source" is inside ApplyState
.
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.
Thanks, assuming you're gonna push a fix?
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.
Yeah I'm looking into it.
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.
Sorry for my bad implementation, I should have been aware of that
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.
All good, it's why we have reviews :)
@hachuyenden you are correct, partly because before that pr trails were not rotated because they were drawn at the positions where they were actually spawned, but after that pr, positions of the trail parts will be recalculated relative to the btw I didn't see breaks that are so obvious like in your pictures, only got a little when the fps drops. |
the i recorded a video showing this. 2024-07-31.22-17-43.mp4the reason your symptom so obvious is probably the trails were actually considered as different parts. |
It's strange that your machine doesn't have any problems while mine does. I'll be playing Barrel roll 12 a lot in the future so I'm very concerned about the cursors if that not look as good as before. Anyway. Nice avatar fumo. If you can improve this PR further I'd be very interested. |
By the way here is my cursor trail clip osu.2024-07-31.21-31-52-935.mp4 |
Description
This PR fixes an issue where the cursor trail becomes disconnected from the cursor when the settings or notification panel is opened. The problem occurs because the cursor trail's screen coordinates are not affected by the UI's horizontal shift, unlike other game objects.
To resolve this, the trail's coordinates are now stored in the CursorTrail object's local space instead of screen space. The coordinates are then converted back to screen space during drawing, ensuring they align correctly with the rest of the game objects that are affected by the panel's horizontal shift.
Screenshot
Left: Before | Right: After