Fix review for text justify
This commit is contained in:
@@ -239,7 +239,6 @@ class Executor {
|
||||
textState.scale[1] * pixelRatio,
|
||||
];
|
||||
const textIsArray = Array.isArray(text);
|
||||
// See: https://github.com/openlayers/openlayers/issues/13481
|
||||
const align = textState.justify
|
||||
? TEXT_ALIGN[textState.justify]
|
||||
: horizontalTextAlign(
|
||||
|
||||
@@ -946,8 +946,6 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
const textAlign = textState.textAlign
|
||||
? textState.textAlign
|
||||
: defaultTextAlign;
|
||||
// Ignore `textState.justify` here,
|
||||
// since rich-text is not supported for the immediate rendering API.
|
||||
if (!contextTextState) {
|
||||
context.font = textState.font;
|
||||
context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);
|
||||
|
||||
@@ -211,8 +211,7 @@ class CanvasTextBuilder extends CanvasBuilder {
|
||||
}
|
||||
this.beginGeometry(geometry, feature);
|
||||
const textAlign = textState.textAlign;
|
||||
// Ignore `textState.justify` here,
|
||||
// since rich-text and also `'\n'` make less sense for line placement.
|
||||
// No `justify` support for line placement.
|
||||
let flatOffset = 0;
|
||||
let flatEnd;
|
||||
for (let o = 0, oo = ends.length; o < oo; ++o) {
|
||||
|
||||
@@ -39,7 +39,6 @@ const DEFAULT_FILL_COLOR = '#333';
|
||||
* If not set, text is justified towards the `textAlign` anchor.
|
||||
* Otherwise, use options `'left'`, `'center'`, or `'right'` to justify the text within the text box.
|
||||
* **Note:** `justify` is ignored for immediate rendering and also for `placement: 'line'`.
|
||||
* See: https://github.com/openlayers/openlayers/issues/13481
|
||||
* @property {string} [textBaseline='middle'] Text base line. Possible values: 'bottom', 'top', 'middle', 'alphabetic',
|
||||
* 'hanging', 'ideographic'.
|
||||
* @property {import("./Fill.js").default} [fill] Fill style. If none is provided, we'll use a dark fill-style (#333).
|
||||
|
||||
Reference in New Issue
Block a user