Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: exaggerate pointer exit listener on mouseout to account for hita…
…reas too close to the artboard border [Bug reported](https://2dimensions.slack.com/archives/CLLCU09T6/p1699924347919509) where hitareas for a listener ~2px away from the Artboard border were not getting their `pointer exit` listener invoked. There seems to be a small rounding issue when taking into account the [2px hitRadius](https://github.com/rive-app/rive-cpp/blob/master/src/animation/state_machine_instance.cpp#L336) we use downstream that doesn't invoke the pointer exit accordingly. Flutter web doesn't have this issue because it taps out early before doing this hitRadius detection by doing a check first on the shape's bounds (which [doesn't exist](https://github.com/rive-app/rive-cpp/blob/master/src/animation/state_machine_instance.cpp#L346) in C++). Adding a large buffer to the coordinates when the user "mouseout"'s the canvas to ensure we report the user has effectively `pointer exit`'d. We can't just add/subtract 2 here because if for example, Rive is setup with `fit: cover`, it expands the rive graphic potentially past the canvas bounds. Open to other suggestions here Diffs= f0ca1b0ef fix: exaggerate pointer exit listener on mouseout to account for hitareas too close to the artboard border (#6319) Co-authored-by: Zachary Plata <plata.zach@gmail.com>
- Loading branch information