Skip to content

Conversation

@insacc
Copy link

@insacc insacc commented Dec 20, 2025

Summary:

  • This changes the way we handle the stroke effects on a text view because using a ReplacementSpan for stroke effects breaks the truncation logic otherwise. This implementation turns the StrokeStyleSpan into a CharacterStyle to hold the data about the strokeWidth and strokeColor and let the ReactTextView handle drawing the stroke which matches the implementation on ios as well and fixes the truncation issue

  • Removes the DiscordShadowStyle we created as that was using a replacementSpan and was having the same truncation issue. Instead to solve the clipping at the left end of the text we're adding a LeadingMarginSpan to account for shadows as well as stroke effects

Tried to keep most of the changes contained in the style span classes we have to make it easier for future use.

Test Plan:

  • Tested on different surfaces and on different devices to make sure that it is working properly

@insacc insacc force-pushed the task/stroke-shadow-fix-ellipsis branch from 3f6de77 to 3ce12ea Compare December 22, 2025 01:54
Add logs

fix build

Add more logs

Add more logs

Setup the stroke view on the text view

Add some more logs

Disable foreground color span when stroke is present

Add more logs

Update the stroke implementation

Reset color filter for the fill pass

Reeanable the foreground color span

Improve the stroke style implementation

Fix the text shadow style span

Update the stroke style implementation

Add leading margin for stroke/shadow that extends beyond text bounds

Fix the build issue

Fix the build
@insacc insacc force-pushed the task/stroke-shadow-fix-ellipsis branch from de22599 to 8f5e09b Compare December 23, 2025 14:28
@insacc insacc marked this pull request as ready for review December 23, 2025 16:08
@insacc insacc requested a review from Flewp December 23, 2025 16:11
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.

2 participants