Skip to content

Comments

Feature: customize target radius and improved pulse animation#107

Open
antonyaiwin wants to merge 6 commits intoayalma:masterfrom
antonyaiwin:feature/customize_target_radius
Open

Feature: customize target radius and improved pulse animation#107
antonyaiwin wants to merge 6 commits intoayalma:masterfrom
antonyaiwin:feature/customize_target_radius

Conversation

@antonyaiwin
Copy link

  • Improved pulse animation for smoother visuals
  • Added support for customizable target radius
  • Improved background offset calculations for alignment across different target sizes

The radius of the tap target can now be customized using the `targetRadius` property on `DescribedFeatureOverlay`. The default radius is 44.

This change also refactors the pulse animation to use `CurvedAnimation` and simplifies the animation logic by introducing helper functions.
This fixes the issue that the TapTarget child is being resized along with the pulse.
When a custom targetRadius is provided, the expanding pulse could overflow
outside the background circle. This happened because the distance between the
content anchorPoint and backgroundPoint did not account for the larger pulse
diameter.

Changes:
- Added `targetRadius` as a parameter to `BackgroundContentLayoutDelegate` calculation.
- Included `targetRadius * 2` (full pulse expansion radius) when computing
  `distanceToOuterPulse`.
- Ensures the pulse always stays fully inside the background circle regardless
  of custom radius size.

This properly aligns the background offset and prevents visual clipping when
larger targets are used.
@antonyaiwin antonyaiwin marked this pull request as draft December 16, 2025 11:50
Improved the documentation for the `targetRadius` property in `DescribedFeatureOverlay` and added a section with an example to the README file.
@antonyaiwin antonyaiwin force-pushed the feature/customize_target_radius branch from 329a61d to 09d6628 Compare December 16, 2025 11:59
@antonyaiwin antonyaiwin marked this pull request as ready for review December 16, 2025 12:01
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.

1 participant