Skip to content

Commit

Permalink
editor+runtime: fix text hit-testing on a locally transformed text
Browse files Browse the repository at this point in the history
It turns out you can have a transform that's not worldTransform to affect where the text run is rendered. E.g. You can have
1. a non-zero origin set on the Text
2. the overflow mode is 'fit', which first scales the text, then world transforms it.

This PR accounts for this in hit testing. I made sure that when there's a non-zero origin set on a text, a hover on the text run works. Also, if the overflow mode is 'fit', things also work.

Known behavior that's undesirable. If the overflow mode is fit or ellipsis, or basically something that affects whether the text run is rendered at all or changes the bounding box of the run considerably without overlap, then hovering over the edges of the text run could result in flicker (due to hit test toggling constantly). I'm not sure of the best fix for this, but maybe users don't hit this very often either.

Diffs=
7c018ff174 editor+runtime: fix text hit-testing on a locally transformed text (#8860)
  • Loading branch information
susan101566 committed Jan 13, 2025
1 parent 35ffca4 commit 6958571
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 @@
8e792d564f1db25480447ccc02192692f1494533
7c018ff174dc69f841e6b5011d995d8b0653ca01
2 changes: 1 addition & 1 deletion submodules/rive-cpp

0 comments on commit 6958571

Please sign in to comment.