steipete / PSPDFTextView

A subclass of UITextView that fixes the most glaring problems from iOS 7 and 7.1.
http://pspdfkit.com
MIT License
873 stars 73 forks source link

Consider textContainerInset #10

Closed hpique closed 10 years ago

hpique commented 10 years ago

Without this, the scroll is sometimes a little off. I’m not 100% this is correct, as I don’t fully understand the relation between contentInset and textContainerInset. That said, my app works much better with this change.

hpique commented 10 years ago

Scratch that. I found a couple of bugs. Will give it a further look in a couple of hours.

hpique commented 10 years ago

After much testing it appears the bugs were not introduced by this pull request. I'll report them as separate issues.

In any case, without this commit scrollToVisibleCaretAnimated: doesn't scroll to the right position when the textView has textContainerInset values.

steipete commented 10 years ago

Are you setting the textContainerInset as well? I'm not even setting them, and - haven't tried yet - but i guess that PR would break my implementation then since textContainerInset is 0 and containerInset is non-nil.

hpique commented 10 years ago

I need to set the textContainerInset to account for a custom translucent toolbar at the bottom, and add a nice margin on top. Couldn't figure out how to do it without it.

hpique commented 10 years ago

I should add that you're (unintentionally) using textContainerInset as well in your demo project, as it has default values of {8, 0, 8, 0}. Without accounting for it, the offset is slightly off.