Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solid stroke with outside positioning #50

Open
endanke opened this issue Jan 13, 2020 · 0 comments
Open

Solid stroke with outside positioning #50

endanke opened this issue Jan 13, 2020 · 0 comments

Comments

@endanke
Copy link

endanke commented Jan 13, 2020

Hi!

I'm trying to use THLabel to create a solid white background around my label that follows the shape of the text. It looks fine mostly, but some letters can cause holes in the stroke's shape, which makes it a bit ugly.

The following image shows the problem with the letter 'i':
IMG_EC9B0D7411C0-1

And the desired output would be:
IMG_2EB23E5F7DC1-1

I've come up with a temporary solution, but it's probably not the most optimal. In the strokeImageWithRect function I've applied a 1px white shadow on the clipping mask, then used this idea to "remove" the opacity of the blurred shadow edges: https://stackoverflow.com/questions/14622202/can-cgcontextcliptomask-mask-all-non-transparent-pixels-with-alpha-1

I wonder if there's any better way of filling the holes directly on the clipping mask's path, without using a shadow.

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

No branches or pull requests

1 participant