Move ol.CanvasFillState to ol/render/canvas

This commit is contained in:
Michael Kuenzli
2018-04-18 10:46:47 +02:00
parent 5e810ccc6a
commit 4f74bcaa31
4 changed files with 13 additions and 14 deletions

View File

@@ -8,6 +8,11 @@ import LRUCache from '../structs/LRUCache.js';
import {create as createTransform} from '../transform.js';
/**
* @typedef {{fillStyle: module:ol/colorlike~ColorLike}} FillState
*/
/**
* @const
* @type {string}

View File

@@ -70,7 +70,7 @@ const CanvasImmediateRenderer = function(context, pixelRatio, extent, transform,
/**
* @private
* @type {?ol.CanvasFillState}
* @type {?module:ol/render/canvas~FillState}
*/
this.contextFillState_ = null;
@@ -88,7 +88,7 @@ const CanvasImmediateRenderer = function(context, pixelRatio, extent, transform,
/**
* @private
* @type {?ol.CanvasFillState}
* @type {?module:ol/render/canvas~FillState}
*/
this.fillState_ = null;
@@ -208,7 +208,7 @@ const CanvasImmediateRenderer = function(context, pixelRatio, extent, transform,
/**
* @private
* @type {?ol.CanvasFillState}
* @type {?module:ol/render/canvas~FillState}
*/
this.textFillState_ = null;
@@ -698,7 +698,7 @@ CanvasImmediateRenderer.prototype.drawMultiPolygon = function(geometry) {
/**
* @param {ol.CanvasFillState} fillState Fill state.
* @param {module:ol/render/canvas~FillState} fillState Fill state.
* @private
*/
CanvasImmediateRenderer.prototype.setContextFillState_ = function(fillState) {

View File

@@ -74,12 +74,12 @@ const CanvasTextReplay = function(
/**
* @private
* @type {?ol.CanvasFillState}
* @type {?module:ol/render/canvas~FillState}
*/
this.textFillState_ = null;
/**
* @type {!Object.<string, ol.CanvasFillState>}
* @type {!Object.<string, module:ol/render/canvas~FillState>}
*/
this.fillStates = {};
@@ -413,7 +413,7 @@ CanvasTextReplay.prototype.drawChars_ = function(begin, end, declutterGroup) {
const fillKey = this.fillKey_;
if (fillState) {
if (!(fillKey in this.fillStates)) {
this.fillStates[fillKey] = /** @type {ol.CanvasFillState} */ ({
this.fillStates[fillKey] = /** @type {module:ol/render/canvas~FillState} */ ({
fillStyle: fillState.fillStyle
});
}
@@ -474,7 +474,7 @@ CanvasTextReplay.prototype.setTextStyle = function(textStyle, declutterGroup) {
} else {
fillState = this.textFillState_;
if (!fillState) {
fillState = this.textFillState_ = /** @type {ol.CanvasFillState} */ ({});
fillState = this.textFillState_ = /** @type {module:ol/render/canvas~FillState} */ ({});
}
fillState.fillStyle = asColorLike(
textFillStyle.getColor() || defaultFillStyle);

View File

@@ -21,12 +21,6 @@ const ol = {};
*/
/**
* @typedef {{fillStyle: module:ol/colorlike~ColorLike}}
*/
ol.CanvasFillState;
/**
* A function returning the canvas element (`{HTMLCanvasElement}`)
* used by the source as an image. The arguments passed to the function are: