-
-
Notifications
You must be signed in to change notification settings - Fork 864
core: Fix for mouse drag behavior #13330
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
base: master
Are you sure you want to change the base?
Conversation
Thank you for contributing! Please run |
@@ -1380,30 +1380,21 @@ impl Player { | |||
// and fires "drag" events. Other objects are ignored. | |||
if context.input.is_mouse_down() { | |||
context.mouse_over_object = new_over_object; |
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.
By the way, this feels odd, shouldn't this value be updated regardless of mouse input? I might just not be seeing something here, so correct me if I'm wrong.
It looks like the code you changed was originally written to implement drag and drop events in AVM1 (#4584). I wonder if these events are different in AVM1 and AVM2. We need to be careful about changing core code because we don't want to regress AVM1. |
Understood, I will test further on some of those games. |
Great! Particularly the games linked to that pull request would be great to test for regressions. |
@n0samu Incriminati, Belly Biff, 3 in 1 checkers, koala checkers, tekken-miguel-caballero-rojo have functional drag and drop with this code. Tested on Linux desktop. |
From a quick look at the code, this looks wrong. The original code made drag events only fire when the old mousedown object was the same as the new mousedown object- this code doesn't check that and fires them regardless. Are you sure this matches Flash Player? On looking at the original question, I suspect the game expects a drag event to be fired despite the mousedown DO changing. Maybe the actual issue is actually that the smaller DOs (individual items) shouldn't be able to be hit-tested? |
Fixes #13327. Tested with the mentioned game on desktop environment using Linux.