Skip to content

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Kamina-sama
Copy link

@Kamina-sama Kamina-sama commented Sep 27, 2023

Fixes #13327. Tested with the mentioned game on desktop environment using Linux.

@Lord-McSweeney
Copy link
Collaborator

Thank you for contributing! Please run cargo fmt in your ruffle directory to fix the failing format tests.

@@ -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;
Copy link
Author

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.

@n0samu
Copy link
Member

n0samu commented Sep 27, 2023

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.

@Kamina-sama
Copy link
Author

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.

@n0samu
Copy link
Member

n0samu commented Sep 27, 2023

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.

@Kamina-sama
Copy link
Author

Kamina-sama commented Sep 27, 2023

@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.

@Lord-McSweeney
Copy link
Collaborator

Lord-McSweeney commented Oct 9, 2023

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?

@danielhjacobs danielhjacobs added A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already) labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

game not registering the mouse button being held down
4 participants