-
Notifications
You must be signed in to change notification settings - Fork 149
MediaAttachment: correct MediaAttachment width calculating #797
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
MediaAttachment: correct MediaAttachment width calculating #797
Conversation
SergioEstevao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good in but can you clarify the questions I left in the comments.
|
|
||
| padding += headIndent | ||
|
|
||
| if paragraphStyle.tailIndent > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why do we need this IF, in what scenarios the tailIdent can be positive or negative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is Discussion of tailIndent from apple:
If positive, this value is the distance from the leading margin (for example, the left margin in left-to-right text). If 0 or negative, it’s the distance from the trailing margin.
For example, a paragraph style designed to fit exactly in a 2-inch wide container has a head indent of 0.0 and a tail indent of 0.0. One designed to fit with a quarter-inch margin has a head indent of 0.25 and a tail indent of –0.25.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So could we rewrite like this:
padding += abs(paragraphStyle.tailIndent) + abs(headIndent)
|
Closing in favor of #828. Thanks a lot sir!! |
|
@jleandroperez - Just double checking... this is the issue and #828 is the PR for this report. Is that correct? |
|
@diegoreymendez Nope! #796 is the issue. #828 is Sergio’s fix Mark II, while this one is the original PR (AKA Fix Mark I). |
Fixes #796
To test:
Insert image or video into block-quote