Nantes icon indicating copy to clipboard operation
Nantes copied to clipboard

Head truncation drawing is incorrect

Open chansen22 opened this issue 5 years ago • 0 comments

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 avatar Apr 03 '19 17:04 chansen22