Repository navigation
Conversation
getLetterSpacing adds space after each character of a row but the last, in ems of the text size. The space widens the text block, so it sizes the background and counts toward maxWidth wrapping. getTextAlign aligns the rows of a multi-line block to its left, center or right edge, independently of getTextAnchor. The default 'auto' keeps the current behavior. Constant layout accessors (getTextAnchor, getAlignmentBaseline and the two new ones) now re-layout the text when their value changes.
…triggers A function accessor's update trigger could equal the value of the constant that replaced it, so the layout was not updated.
This branch has not been deployed
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.
Closes #10855
TextLayercannot space characters, and it aligns the rows of a multi-line label bygetTextAnchor. The deck.gl-communitybasemap-layersmodule patches the privatetransformParagraphto emulate MapLibre'stext-letter-spacingandtext-justify(visgl/deck.gl-community#861). It can switch to these props.Change List
getLetterSpacing: em spacing after each character but a row's lastmaxWidthwrappinggetTextAlign:'auto'(default, current behavior),'left','center','right'getTextAnchor,getAlignmentBaseline) now updates the layouttext-layer-letter-spacing-alignBefore (
text-layer-multi-lines, current master):After: the same labels with letter spacing 0.1 / 0.2 / 0.3 em and rows aligned right / left / center, while anchored start / middle / end:
Ran
yarn lint, the node and headless suites, and the WebGL and WebGPU render tests (headless Chromium).