Fix sizeThatFits: and textInsets by gskbyte · Pull Request #730 · TTTAttributedLabel/TTTAttributedLabel · GitHub
Skip to content

Fix sizeThatFits: and textInsets#730

Open
gskbyte wants to merge 5 commits into
TTTAttributedLabel:masterfrom
gskbyte:fix-sizeThatFits-textInsets
Open

Fix sizeThatFits: and textInsets#730
gskbyte wants to merge 5 commits into
TTTAttributedLabel:masterfrom
gskbyte:fix-sizeThatFits-textInsets

Conversation

@gskbyte

@gskbyte gskbyte commented Nov 17, 2016

Copy link
Copy Markdown
Contributor

Fixes the issue of size not properly computed when textInsets have a value different to UIEdgeInsetsZero, which could provoke the following bug:

screen shot 2016-11-17 at 16 49 12

A test has been added to prove that the fix works. There is also a change to avoid an unnecessary allocation inside sizeThatFits: when the attributedTruncationToken is not set.

Thanks for this great library!

@gskbyte gskbyte changed the title Fix size that fits text insets Fix sizeThatFits: and textInsets Nov 17, 2016
Comment thread TTTAttributedLabel/TTTAttributedLabel.m Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the copy necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually not necessary, I will remove it in the next commit.

@segiddins

Copy link
Copy Markdown
Member

This needs to pass on CI

@gskbyte

gskbyte commented Nov 18, 2016

Copy link
Copy Markdown
Contributor Author

The build failed in the CI because of a timeout and I can't retrigger it (the CircleCI API returns permission denied). Could you please retry it?

@gskbyte

gskbyte commented Nov 18, 2016

Copy link
Copy Markdown
Contributor Author

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