Skip to content
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

core: Hide focus highlight on invalid and empty bounds #17037

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Jul 7, 2024

Fixes #17034.

Flash Player has a fairly complicated, implementation-dependent behavior related to degenerate bounds and bounds that change after being highlighted. It seems that the highlight is hidden when there's nothing to be rendered:

  1. For a clip with untouched graphics, the highlight is hidden.
  2. For a clip with moveTo(0,0) lineTo(0,0), the highlight is not hidden.

Sometimes highlight is not updated after highlight bounds change, but this behavior is rare and inconsistent, it even differs depending on when the update happens.

However, the most common case of depending on the behavior above is when the SWF creates a movie clip, focuses it, and then adds some content to it. In that case FP will not render the highlight (even if in theory it should). Hiding focus highlight on invalid and empty bounds covers this case, but:

  1. In some rare cases, it will hide the highlight when it shouldn't (e.g. non-empty graphics degenerated into a point).
  2. It does not take into account that sometimes FP does not update highlight bounds.

However, I've never seen these cases in real SWFs, only during testing.

@kjarosh kjarosh force-pushed the focus-highlight-empty-clip branch from 232f758 to a3ae6cd Compare July 7, 2024 21:41
@kjarosh kjarosh added the waiting-on-review Waiting on review from a Ruffle team member label Jul 8, 2024
@kjarosh kjarosh force-pushed the focus-highlight-empty-clip branch from a3ae6cd to 52bc012 Compare July 12, 2024 11:28
Copy link
Contributor

@Dinnerbone Dinnerbone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The majority of the (non-test) changes is a comment... classic Flash :D

@torokati44 torokati44 enabled auto-merge (rebase) July 12, 2024 12:33
@torokati44 torokati44 merged commit 4e3b59b into ruffle-rs:master Jul 12, 2024
17 checks passed
@kjarosh kjarosh deleted the focus-highlight-empty-clip branch July 12, 2024 13:06
@danielhjacobs danielhjacobs removed the waiting-on-review Waiting on review from a Ruffle team member label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jinsei owata no daibouken 2 - yellow line in map 11
4 participants