Remove type cast in ol/render/canvas/TextBuilder
This commit is contained in:
@@ -308,7 +308,7 @@ class CanvasTextBuilder extends CanvasBuilder {
|
|||||||
const strokeKey = this.strokeKey_;
|
const strokeKey = this.strokeKey_;
|
||||||
if (strokeState) {
|
if (strokeState) {
|
||||||
if (!(strokeKey in this.strokeStates)) {
|
if (!(strokeKey in this.strokeStates)) {
|
||||||
this.strokeStates[strokeKey] = /** @type {import("../canvas.js").StrokeState} */ ({
|
this.strokeStates[strokeKey] = {
|
||||||
strokeStyle: strokeState.strokeStyle,
|
strokeStyle: strokeState.strokeStyle,
|
||||||
lineCap: strokeState.lineCap,
|
lineCap: strokeState.lineCap,
|
||||||
lineDashOffset: strokeState.lineDashOffset,
|
lineDashOffset: strokeState.lineDashOffset,
|
||||||
@@ -316,24 +316,24 @@ class CanvasTextBuilder extends CanvasBuilder {
|
|||||||
lineJoin: strokeState.lineJoin,
|
lineJoin: strokeState.lineJoin,
|
||||||
miterLimit: strokeState.miterLimit,
|
miterLimit: strokeState.miterLimit,
|
||||||
lineDash: strokeState.lineDash
|
lineDash: strokeState.lineDash
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const textKey = this.textKey_;
|
const textKey = this.textKey_;
|
||||||
if (!(textKey in this.textStates)) {
|
if (!(textKey in this.textStates)) {
|
||||||
this.textStates[textKey] = /** @type {import("../canvas.js").TextState} */ ({
|
this.textStates[textKey] = {
|
||||||
font: textState.font,
|
font: textState.font,
|
||||||
textAlign: textState.textAlign || defaultTextAlign,
|
textAlign: textState.textAlign || defaultTextAlign,
|
||||||
textBaseline: textState.textBaseline || defaultTextBaseline,
|
textBaseline: textState.textBaseline || defaultTextBaseline,
|
||||||
scale: textState.scale
|
scale: textState.scale
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
const fillKey = this.fillKey_;
|
const fillKey = this.fillKey_;
|
||||||
if (fillState) {
|
if (fillState) {
|
||||||
if (!(fillKey in this.fillStates)) {
|
if (!(fillKey in this.fillStates)) {
|
||||||
this.fillStates[fillKey] = /** @type {import("../canvas.js").FillState} */ ({
|
this.fillStates[fillKey] = {
|
||||||
fillStyle: fillState.fillStyle
|
fillStyle: fillState.fillStyle
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user