Repository navigation
fix(treemap): clear the parent transform of a label that became single-line - #4274
Merged
Merged
Conversation
…e-line A multiline treemap label is positioned by the transform of its parent group, a single-line one by the x and y of the text itself. When a label went from multiline to single-line, the old transform stayed and was applied on top of the new x and y. Remove the parent transform when the position is written to the text. Fix naver#4273
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.
Issue
Fix #4273
Details
A multiline treemap label is positioned by the
transformof its parentg, a single-line one by thexandyof thetextitself. When a centered label went from multiline to single-line (for example after a resize with atreemap.label.formatthat returns fewer lines for narrow tiles), the old parenttransformstayed and was applied on top of the newxandy, so the label was drawn outside its tile.redrawText()now removes the parenttransformwhen it writes the position to the text.The reverse direction (one line to two lines) is not changed: the stale
yis measured throughgetBBox()ingetCenteredTextPos()and compensated. A test covers both directions by comparing the label positions with a chart drawn directly in the final state. It fails without the change (375vs186).This is based on
latestso that it can be released as a patch.