Move ol.CanvasFillStrokeState to ol/render/canvas

This commit is contained in:
Michael Kuenzli
2018-04-18 14:02:46 +02:00
parent 223ef34898
commit 113785f048
3 changed files with 31 additions and 31 deletions

View File

@@ -13,6 +13,28 @@ import {create as createTransform} from '../transform.js';
*/
/**
* @typedef {Object} FillStrokeState
* @property {module:ol/colorlike~ColorLike} [currentFillStyle]
* @property {module:ol/colorlike~ColorLike} [currentStrokeStyle]
* @property string{} [currentLineCap]
* @property {Array.<number>} currentLineDash
* @property {number} [currentLineDashOffset]
* @property {string} [currentLineJoin]
* @property {number} [currentLineWidth]
* @property {number} [currentMiterLimit]
* @property {number} [lastStroke]
* @property {module:ol/colorlike~ColorLike} [fillStyle]
* @property {module:ol/colorlike~ColorLike} [strokeStyle]
* @property {string} [lineCap]
* @property {Array.<number>} lineDash
* @property {number} [lineDashOffset]
* @property {string} [lineJoin]
* @property {number} [lineWidth]
* @property {number} [miterLimit]
*/
/**
* @const
* @type {string}

View File

@@ -147,9 +147,9 @@ const CanvasReplay = function(tolerance, maxExtent, resolution, pixelRatio, over
/**
* @protected
* @type {ol.CanvasFillStrokeState}
* @type {module:ol/render/canvas~FillStrokeState}
*/
this.state = /** @type {ol.CanvasFillStrokeState} */ ({});
this.state = /** @type {module:ol/render/canvas~FillStrokeState} */ ({});
/**
* @private
@@ -957,7 +957,7 @@ CanvasReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
/**
* @param {ol.CanvasFillStrokeState} state State.
* @param {module:ol/render/canvas~FillStrokeState} state State.
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
* @return {Array.<*>} Fill instruction.
*/
@@ -973,7 +973,7 @@ CanvasReplay.prototype.createFill = function(state, geometry) {
/**
* @param {ol.CanvasFillStrokeState} state State.
* @param {module:ol/render/canvas~FillStrokeState} state State.
*/
CanvasReplay.prototype.applyStroke = function(state) {
this.instructions.push(this.createStroke(state));
@@ -981,7 +981,7 @@ CanvasReplay.prototype.applyStroke = function(state) {
/**
* @param {ol.CanvasFillStrokeState} state State.
* @param {module:ol/render/canvas~FillStrokeState} state State.
* @return {Array.<*>} Stroke instruction.
*/
CanvasReplay.prototype.createStroke = function(state) {
@@ -995,8 +995,8 @@ CanvasReplay.prototype.createStroke = function(state) {
/**
* @param {ol.CanvasFillStrokeState} state State.
* @param {function(this:ol.render.canvas.Replay, ol.CanvasFillStrokeState, (module:ol/geom/Geometry~Geometry|ol.render.Feature)):Array.<*>} createFill Create fill.
* @param {module:ol/render/canvas~FillStrokeState} state State.
* @param {function(this:ol.render.canvas.Replay, module:ol/render/canvas~FillStrokeState, (module:ol/geom/Geometry~Geometry|ol.render.Feature)):Array.<*>} createFill Create fill.
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
*/
CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) {
@@ -1011,8 +1011,8 @@ CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) {
/**
* @param {ol.CanvasFillStrokeState} state State.
* @param {function(this:ol.render.canvas.Replay, ol.CanvasFillStrokeState)} applyStroke Apply stroke.
* @param {module:ol/render/canvas~FillStrokeState} state State.
* @param {function(this:ol.render.canvas.Replay, module:ol/render/canvas~FillStrokeState)} applyStroke Apply stroke.
*/
CanvasReplay.prototype.updateStrokeStyle = function(state, applyStroke) {
const strokeStyle = state.strokeStyle;

View File

@@ -21,28 +21,6 @@ const ol = {};
*/
/**
* @typedef {{currentFillStyle: (module:ol/colorlike~ColorLike|undefined),
* currentStrokeStyle: (module:ol/colorlike~ColorLike|undefined),
* currentLineCap: (string|undefined),
* currentLineDash: Array.<number>,
* currentLineDashOffset: (number|undefined),
* currentLineJoin: (string|undefined),
* currentLineWidth: (number|undefined),
* currentMiterLimit: (number|undefined),
* lastStroke: (number|undefined),
* fillStyle: (module:ol/colorlike~ColorLike|undefined),
* strokeStyle: (module:ol/colorlike~ColorLike|undefined),
* lineCap: (string|undefined),
* lineDash: Array.<number>,
* lineDashOffset: (number|undefined),
* lineJoin: (string|undefined),
* lineWidth: (number|undefined),
* miterLimit: (number|undefined)}|null}
*/
ol.CanvasFillStrokeState;
/**
* @typedef {{lineCap: string,
* lineDash: Array.<number>,