fix: Fix bug that could cause errant line when rendering. #9333
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.
The basics
The details
Resolves
Fixes #6028
Proposed Changes
This PR updates the drawer to not include the ascender height (which goes negative/above the starting point of a top row, e.g. for hats) when drawing a vertical path downwards to complete the right edge of the top row. Under certain circumstances, this could exceed the total height of the block and appear as a stray dangly line on the bottom right corner.
There is actually at least 3x redundancy for parts of the right edge of a block path in practice, since the top/bottom rows don't have additional height beyond that caused by their rounded corners/notches/hat. However, because they could, the top and bottom rows draw a vertical line corresponding to the row's total height along the right edge of the block. These generally overlap the middle rows of blocks and are thus not visible, but #6469 tracks cleaning them up. In theory the top/bottom row drawing methods could track the vertical delta between the starting point and ending point when drawing each element in the row, and subtract that from the overall row height to draw the exact amount needed, but this would be a large refactor and I think requires either writing an SVG path parser to evaluate the height of a path fragment, or making breaking changes to the interfaces for e.g. hats, which currently don't know their height outside of what is encoded in the path.