Fix #3011: Support left- and right-alignment for multi-line messages and notes #3194
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.
📑 Summary
Previously, messages and notes that had multiple lines (via
<br>
-tags) were only displayed correctlywhen using the default
center
value for themessageAlign
andnoteAlign
configuration options.Using
left
orright
for the alignment options caused the text to collapse and become illegible,as outlined in issue #3011.
Now, texts in messages and notes are always vertically centered and alignment options correctly apply for
both single and multi-line content.
Resolves #3011
📏 Design Decisions
This comes as a side-effect from how the internal
valign
text-rendering option was configured formessages and notes:
Both the
anchor
option (which controls left-right alignment) and thevalign
option (which controlsvertical top-down placement) were set to the same value, the user-provided
messageAlign
config option.While
left
andright
are valid values for theanchor
option, they were effectively no-ops for thevalign
option, which only supportstop
,start
,middle
,center
,bottom
, andend
.To fix the issue, the
valign
property is now always set tocenter
for notes and messages.Similarly, the
dominantBaseline
option of texts is now always set tomiddle
, rather than setting it toeither
text-{before,after}-edge
, which caused left-aligned multi-line text to always be "top-left" alignedinside a note (or "bottom-right" when attempting to right-align).
📋 Tasks
Make sure you
develop
branch