Merge pull request #7637 from marcjansen/named-exports-color

Named exports from the ol/color module
This commit is contained in:
Marc Jansen
2017-12-19 17:11:03 +01:00
committed by GitHub
11 changed files with 95 additions and 108 deletions

View File

@@ -2,7 +2,7 @@
* @module ol/render/canvas/PolygonReplay
*/
import {inherits} from '../../index.js';
import _ol_color_ from '../../color.js';
import {asString} from '../../color.js';
import _ol_geom_flat_simplify_ from '../../geom/flat/simplify.js';
import _ol_render_canvas_ from '../canvas.js';
import _ol_render_canvas_Instruction_ from '../canvas/Instruction.js';
@@ -91,7 +91,7 @@ _ol_render_canvas_PolygonReplay_.prototype.drawCircle = function(circleGeometry,
// always fill the circle for hit detection
this.hitDetectionInstructions.push([
_ol_render_canvas_Instruction_.SET_FILL_STYLE,
_ol_color_.asString(_ol_render_canvas_.defaultFillStyle)
asString(_ol_render_canvas_.defaultFillStyle)
]);
if (state.strokeStyle !== undefined) {
this.hitDetectionInstructions.push([
@@ -133,7 +133,7 @@ _ol_render_canvas_PolygonReplay_.prototype.drawPolygon = function(polygonGeometr
// always fill the polygon for hit detection
this.hitDetectionInstructions.push([
_ol_render_canvas_Instruction_.SET_FILL_STYLE,
_ol_color_.asString(_ol_render_canvas_.defaultFillStyle)]
asString(_ol_render_canvas_.defaultFillStyle)]
);
if (state.strokeStyle !== undefined) {
this.hitDetectionInstructions.push([
@@ -165,7 +165,7 @@ _ol_render_canvas_PolygonReplay_.prototype.drawMultiPolygon = function(multiPoly
// always fill the multi-polygon for hit detection
this.hitDetectionInstructions.push([
_ol_render_canvas_Instruction_.SET_FILL_STYLE,
_ol_color_.asString(_ol_render_canvas_.defaultFillStyle)
asString(_ol_render_canvas_.defaultFillStyle)
]);
if (state.strokeStyle !== undefined) {
this.hitDetectionInstructions.push([

View File

@@ -3,7 +3,7 @@
*/
import {getUid, inherits} from '../../index.js';
import _ol_array_ from '../../array.js';
import _ol_color_ from '../../color.js';
import {asArray} from '../../color.js';
import {intersects} from '../../extent.js';
import _ol_obj_ from '../../obj.js';
import _ol_geom_flat_transform_ from '../../geom/flat/transform.js';
@@ -387,7 +387,7 @@ _ol_render_webgl_CircleReplay_.prototype.setFillStrokeStyle = function(fillStyle
strokeStyleColor = strokeStyle.getColor();
if (!(strokeStyleColor instanceof CanvasGradient) &&
!(strokeStyleColor instanceof CanvasPattern)) {
strokeStyleColor = _ol_color_.asArray(strokeStyleColor).map(function(c, i) {
strokeStyleColor = asArray(strokeStyleColor).map(function(c, i) {
return i != 3 ? c / 255 : c;
}) || _ol_render_webgl_.defaultStrokeStyle;
} else {
@@ -403,7 +403,7 @@ _ol_render_webgl_CircleReplay_.prototype.setFillStrokeStyle = function(fillStyle
var fillStyleColor = fillStyle ? fillStyle.getColor() : [0, 0, 0, 0];
if (!(fillStyleColor instanceof CanvasGradient) &&
!(fillStyleColor instanceof CanvasPattern)) {
fillStyleColor = _ol_color_.asArray(fillStyleColor).map(function(c, i) {
fillStyleColor = asArray(fillStyleColor).map(function(c, i) {
return i != 3 ? c / 255 : c;
}) || _ol_render_webgl_.defaultFillStyle;
} else {

View File

@@ -3,7 +3,7 @@
*/
import {getUid, inherits} from '../../index.js';
import _ol_array_ from '../../array.js';
import _ol_color_ from '../../color.js';
import {asArray} from '../../color.js';
import {intersects} from '../../extent.js';
import _ol_geom_flat_orient_ from '../../geom/flat/orient.js';
import _ol_geom_flat_transform_ from '../../geom/flat/transform.js';
@@ -647,7 +647,7 @@ _ol_render_webgl_LineStringReplay_.prototype.setFillStrokeStyle = function(fillS
var strokeStyleColor = strokeStyle.getColor();
if (!(strokeStyleColor instanceof CanvasGradient) &&
!(strokeStyleColor instanceof CanvasPattern)) {
strokeStyleColor = _ol_color_.asArray(strokeStyleColor).map(function(c, i) {
strokeStyleColor = asArray(strokeStyleColor).map(function(c, i) {
return i != 3 ? c / 255 : c;
}) || _ol_render_webgl_.defaultStrokeStyle;
} else {

View File

@@ -3,7 +3,7 @@
*/
import {getUid, inherits} from '../../index.js';
import _ol_array_ from '../../array.js';
import _ol_color_ from '../../color.js';
import {asArray} from '../../color.js';
import {intersects} from '../../extent.js';
import _ol_obj_ from '../../obj.js';
import _ol_geom_flat_contains_ from '../../geom/flat/contains.js';
@@ -1048,7 +1048,7 @@ _ol_render_webgl_PolygonReplay_.prototype.setFillStrokeStyle = function(fillStyl
var fillStyleColor = fillStyle ? fillStyle.getColor() : [0, 0, 0, 0];
if (!(fillStyleColor instanceof CanvasGradient) &&
!(fillStyleColor instanceof CanvasPattern)) {
fillStyleColor = _ol_color_.asArray(fillStyleColor).map(function(c, i) {
fillStyleColor = asArray(fillStyleColor).map(function(c, i) {
return i != 3 ? c / 255 : c;
}) || _ol_render_webgl_.defaultFillStyle;
} else {