Move ol.CanvasTextState to ol/render/canvas
This commit is contained in:
@@ -47,6 +47,14 @@ import {create as createTransform} from '../transform.js';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} TextState
|
||||||
|
* @property {string} font
|
||||||
|
* @property {string} [textAlign]
|
||||||
|
* @property {string} textBaseline
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const CanvasImmediateRenderer = function(context, pixelRatio, extent, transform,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?ol.CanvasTextState}
|
* @type {?module:ol/render/canvas~TextState}
|
||||||
*/
|
*/
|
||||||
this.contextTextState_ = null;
|
this.contextTextState_ = null;
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ const CanvasImmediateRenderer = function(context, pixelRatio, extent, transform,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?ol.CanvasTextState}
|
* @type {?module:ol/render/canvas~TextState}
|
||||||
*/
|
*/
|
||||||
this.textState_ = null;
|
this.textState_ = null;
|
||||||
|
|
||||||
@@ -775,7 +775,7 @@ CanvasImmediateRenderer.prototype.setContextStrokeState_ = function(strokeState)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.CanvasTextState} textState Text state.
|
* @param {module:ol/render/canvas~TextState} textState Text state.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
CanvasImmediateRenderer.prototype.setContextTextState_ = function(textState) {
|
CanvasImmediateRenderer.prototype.setContextTextState_ = function(textState) {
|
||||||
|
|||||||
@@ -96,12 +96,12 @@ const CanvasTextReplay = function(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.CanvasTextState}
|
* @type {module:ol/render/canvas~TextState}
|
||||||
*/
|
*/
|
||||||
this.textState_ = /** @type {ol.CanvasTextState} */ ({});
|
this.textState_ = /** @type {module:ol/render/canvas~TextState} */ ({});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!Object.<string, ol.CanvasTextState>}
|
* @type {!Object.<string, module:ol/render/canvas~TextState>}
|
||||||
*/
|
*/
|
||||||
this.textStates = {};
|
this.textStates = {};
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ CanvasTextReplay.prototype.drawChars_ = function(begin, end, declutterGroup) {
|
|||||||
}
|
}
|
||||||
const textKey = this.textKey_;
|
const textKey = this.textKey_;
|
||||||
if (!(this.textKey_ in this.textStates)) {
|
if (!(this.textKey_ in this.textStates)) {
|
||||||
this.textStates[this.textKey_] = /** @type {ol.CanvasTextState} */ ({
|
this.textStates[this.textKey_] = /** @type {module:ol/render/canvas~TextState} */ ({
|
||||||
font: textState.font,
|
font: textState.font,
|
||||||
textAlign: textState.textAlign || defaultTextAlign,
|
textAlign: textState.textAlign || defaultTextAlign,
|
||||||
scale: textState.scale
|
scale: textState.scale
|
||||||
|
|||||||
@@ -21,14 +21,6 @@ const ol = {};
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{font: string,
|
|
||||||
* textAlign: (string|undefined),
|
|
||||||
* textBaseline: string}}
|
|
||||||
*/
|
|
||||||
ol.CanvasTextState;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container for decluttered replay instructions that need to be rendered or
|
* Container for decluttered replay instructions that need to be rendered or
|
||||||
* omitted together, i.e. when styles render both an image and text, or for the
|
* omitted together, i.e. when styles render both an image and text, or for the
|
||||||
|
|||||||
Reference in New Issue
Block a user