Skip to content

Commit

Permalink
Fix bidi
Browse files Browse the repository at this point in the history
We weren't properly re-ordering complex "nested levels" (more than one level of bidi) of bidi runs.

Examples from here: https://www.iamcal.com/understanding-bidirectional-text/

![CleanShot 2024-11-07 at 16 49 09@2x](https://github.com/user-attachments/assets/fbe63ea2-875c-459a-b5d5-6e0654848b33)
UAT on the left and changes from this PR on the right.

I'd applied a naive solution assuming that when the paragraph was left to right we could simply blast through the runs in logical order, but that's not strictly true. You need to always order based on bidi levels. This PR propagates the bidi level (not just whether it's LTR or RTL) so the ordering can be done correctly.

Also adds a golden (thanks @susan101566 [for the notes](https://www.notion.so/rive-app/Debug-Rive-Clients-fe6145fb4d25479b9c7122528752892e?pvs=4#ae2cbdb8bf0541fcb187bb7b330db2b1) and @csmartdalton for details).

Diffs=
01066ff6a0 Fix bidi (#8517)
  • Loading branch information
luigi-rosso committed Nov 8, 2024
1 parent c683bec commit 156cca5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8296d8771100fd36ba95655906be38bfe7108c62
01066ff6a08da5675145a6a6e5b7cd0ffa73087d

0 comments on commit 156cca5

Please sign in to comment.