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

Head truncation drawing is incorrect #22

Open
chansen22 opened this issue Apr 3, 2019 · 0 comments
Open

Head truncation drawing is incorrect #22

chansen22 opened this issue Apr 3, 2019 · 0 comments
Labels
bug Something isn't working Truncation

Comments

@chansen22
Copy link
Contributor

Describe the bug
Setting lineBreakMode to .byTruncatingHead or .byTruncatingMiddle causes the label to paint incorrectly. It truncates the head and the tail, or the middle and the tail, and it doesn't paint the correct section of the label (for .byTruncatingHead).

To Reproduce
Steps to reproduce the behavior:

  1. Run example app
  2. See truncated head and truncated middle examples

Expected behavior
It should paint like UILabel paints. Something like the last line of the string, with the truncation token only appearing at the front of the label, instead of at the front and the end.

Screenshots
image
image

Additional context
Potentially changing the truncation code to check against lineBreakMode before deciding how to truncate might be the fix.

@chansen22 chansen22 added Truncation bug Something isn't working labels Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Truncation
Projects
None yet
Development

No branches or pull requests

1 participant