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

text: Fix selection background rendering #18437

Merged
merged 7 commits into from
Nov 15, 2024

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Oct 31, 2024

This PR most importantly fixes the following problems:

  • missing selection background for spaces in some places,
  • weird selection background with different font sizes in one line,
  • invalid selection background for non-zero leading.

However, this does not fix the problem of selected text not being always rendered over anything else. There's max_outliers added due to that in some images. Also it does not take into account differences resulting from using device fonts (there are some).

Fixes #14713.

Before After

@kjarosh kjarosh added text Issues relating to text rendering/input A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already) labels Oct 31, 2024
@kjarosh kjarosh added the waiting-on-review Waiting on review from a Ruffle team member label Oct 31, 2024
This is helpful for situations where we want x-axis positions only.
This makes render_layout_box smaller and makes it possible to use it outside
of this function.
This refactor makes it possible to iterate over vvisible lines multiple
times in other places.
Flash Player renders the black selection rectangles in the background,
and takes into consideration line bounds and conditionally its leading.
This test verifies how the text selection is rendered for
various values of leading.
This test verifies how FP renders selection when there
are multiple font sizes in one line.
@Dinnerbone Dinnerbone enabled auto-merge (rebase) November 15, 2024 17:06
@Dinnerbone Dinnerbone merged commit 7ec6bdc into ruffle-rs:master Nov 15, 2024
22 checks passed
@kjarosh kjarosh deleted the text-selection branch November 15, 2024 22:45
@kjarosh kjarosh removed the waiting-on-review Waiting on review from a Ruffle team member label Nov 15, 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) text Issues relating to text rendering/input
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cursor selection no longer appears over whitespace
2 participants