Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An image with an empty alt was painted one gap below its line, so the paragraph after it ended up beside the image.
was the broken case,with any alt was fine.Cause:
gap_top()guessed whether the reported line height already contains theimagegapspace withline_h > gap + 8.0. With an empty alt the line holds only shrunk marks, so its height is exactly the gap and the comparison failed. The code then added the line height a second time.Fix: the decision is now
line_h >= gap, extracted into the puregap_top_for()with unit tests for the four cases (empty line, line with text, height that does not cover the gap yet, and a tiny requested gap).Verified with the release build in Xvfb: empty alt, empty alt with
|240, alt with text and a 48 px image. In all four the paragraph after the image sits below it. Before the fix the empty alt cases had the image one gap lower and the paragraph beside it.Closes #202