Improve jsDoc and some naming
This commit is contained in:
@@ -59,7 +59,7 @@ const features = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
function createStyleFunction({textAlign, justify}) {
|
function createStyle({textAlign, justify}) {
|
||||||
return new Style({
|
return new Style({
|
||||||
image: new CircleStyle({
|
image: new CircleStyle({
|
||||||
radius: 10,
|
radius: 10,
|
||||||
@@ -98,7 +98,7 @@ const vectorPoints = new VectorLayer({
|
|||||||
const feature = new Feature({
|
const feature = new Feature({
|
||||||
geometry: featureOptions.geometry,
|
geometry: featureOptions.geometry,
|
||||||
});
|
});
|
||||||
feature.setStyle(createStyleFunction(featureOptions));
|
feature.setStyle(createStyle(featureOptions));
|
||||||
return feature;
|
return feature;
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -946,7 +946,8 @@ class CanvasImmediateRenderer extends VectorContext {
|
|||||||
const textAlign = textState.textAlign
|
const textAlign = textState.textAlign
|
||||||
? textState.textAlign
|
? textState.textAlign
|
||||||
: defaultTextAlign;
|
: defaultTextAlign;
|
||||||
// Ignore justification here, since rich-text and also `'\n'` make less sense for line placement.
|
// Ignore `textState.justify` here,
|
||||||
|
// since rich-text is not supported for the immediate rendering API.
|
||||||
if (!contextTextState) {
|
if (!contextTextState) {
|
||||||
context.font = textState.font;
|
context.font = textState.font;
|
||||||
context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);
|
context.textAlign = /** @type {CanvasTextAlign} */ (textAlign);
|
||||||
|
|||||||
@@ -211,7 +211,8 @@ class CanvasTextBuilder extends CanvasBuilder {
|
|||||||
}
|
}
|
||||||
this.beginGeometry(geometry, feature);
|
this.beginGeometry(geometry, feature);
|
||||||
const textAlign = textState.textAlign;
|
const textAlign = textState.textAlign;
|
||||||
// Ignore justification here, since rich-text and also `'\n'` make less sense for line placement.
|
// Ignore `textState.justify` here,
|
||||||
|
// since rich-text and also `'\n'` make less sense for line placement.
|
||||||
let flatOffset = 0;
|
let flatOffset = 0;
|
||||||
let flatEnd;
|
let flatEnd;
|
||||||
for (let o = 0, oo = ends.length; o < oo; ++o) {
|
for (let o = 0, oo = ends.length; o < oo; ++o) {
|
||||||
|
|||||||
Reference in New Issue
Block a user