Repository navigation
Refactor titleGrob() - #5273
Merged
Merged
Refactor titleGrob()#5273
titleGrob()#5273Conversation
teunbrand
commented
Apr 17, 2023
teunbrand
commented
Apr 17, 2023
Merged
thomasp85
approved these changes
Apr 21, 2023
thomasp85
left a comment
Member
There was a problem hiding this comment.
LGTM... Can I get you to run the visual tests on a non-arm64 computer (assuming you are working on a M1 Mac). I've found the chip architecture influences these weird rounding issues and all the large theme tests never matches on my machine
Collaborator
Author
These visual tests were run on a windows machine with an x64-based processor. Bit weird that CPU architecture matters for this rounding. |
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.
This PR aims to fix a performance bottleneck for #5030 as identified in #5030 (comment).
Briefly, it introduces the following changes:
titleGrobgrobs no longer have viewports.textGrobis adjusted to get the same effect.titleGrob()constructor now does the job of what previously was done bytitle_spec()andadd_margins().assemble_strip()no longer needs to awkwardly hassle with all these viewports.title_spec(),add_margins(),margin_width(),margin_height()have become obsolete. I've removed them, but we might expect this to bite us during revdepchecks because they're missing.Benchmark below shows a ~4 fold reduction in drawing time for 574 titleGrobs.
Created on 2023-04-17 with reprex v2.0.2