Remove goog.isDef from colormatrix.js (-12 B)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
goog.provide('ol.color.Matrix');
|
||||
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol');
|
||||
|
||||
|
||||
|
||||
@@ -165,39 +166,42 @@ ol.color.Matrix.makeSaturation = function(matrix, value) {
|
||||
ol.color.Matrix.prototype.getMatrix = function(
|
||||
brightness, contrast, hue, saturation) {
|
||||
var colorMatrixDirty = false;
|
||||
if (goog.isDef(brightness) && brightness !== this.brightness_) {
|
||||
ol.color.Matrix.makeBrightness(this.brightnessMatrix_, brightness);
|
||||
if (ol.isDef(brightness) && brightness !== this.brightness_) {
|
||||
ol.color.Matrix.makeBrightness(this.brightnessMatrix_,
|
||||
/** @type {number} */ (brightness));
|
||||
this.brightness_ = brightness;
|
||||
colorMatrixDirty = true;
|
||||
}
|
||||
if (goog.isDef(contrast) && contrast !== this.contrast_) {
|
||||
ol.color.Matrix.makeContrast(this.contrastMatrix_, contrast);
|
||||
if (ol.isDef(contrast) && contrast !== this.contrast_) {
|
||||
ol.color.Matrix.makeContrast(this.contrastMatrix_,
|
||||
/** @type {number} */ (contrast));
|
||||
this.contrast_ = contrast;
|
||||
colorMatrixDirty = true;
|
||||
}
|
||||
if (goog.isDef(hue) && hue !== this.hue_) {
|
||||
ol.color.Matrix.makeHue(this.hueMatrix_, hue);
|
||||
if (ol.isDef(hue) && hue !== this.hue_) {
|
||||
ol.color.Matrix.makeHue(this.hueMatrix_, /** @type {number} */ (hue));
|
||||
this.hue_ = hue;
|
||||
colorMatrixDirty = true;
|
||||
}
|
||||
if (goog.isDef(saturation) && saturation !== this.saturation_) {
|
||||
ol.color.Matrix.makeSaturation(this.saturationMatrix_, saturation);
|
||||
if (ol.isDef(saturation) && saturation !== this.saturation_) {
|
||||
ol.color.Matrix.makeSaturation(this.saturationMatrix_,
|
||||
/** @type {number} */ (saturation));
|
||||
this.saturation_ = saturation;
|
||||
colorMatrixDirty = true;
|
||||
}
|
||||
if (colorMatrixDirty) {
|
||||
var colorMatrix = this.colorMatrix_;
|
||||
goog.vec.Mat4.makeIdentity(colorMatrix);
|
||||
if (goog.isDef(contrast)) {
|
||||
if (ol.isDef(contrast)) {
|
||||
goog.vec.Mat4.multMat(colorMatrix, this.contrastMatrix_, colorMatrix);
|
||||
}
|
||||
if (goog.isDef(brightness)) {
|
||||
if (ol.isDef(brightness)) {
|
||||
goog.vec.Mat4.multMat(colorMatrix, this.brightnessMatrix_, colorMatrix);
|
||||
}
|
||||
if (goog.isDef(saturation)) {
|
||||
if (ol.isDef(saturation)) {
|
||||
goog.vec.Mat4.multMat(colorMatrix, this.saturationMatrix_, colorMatrix);
|
||||
}
|
||||
if (goog.isDef(hue)) {
|
||||
if (ol.isDef(hue)) {
|
||||
goog.vec.Mat4.multMat(colorMatrix, this.hueMatrix_, colorMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
10
src/ol/ol.js
10
src/ol/ol.js
@@ -240,3 +240,13 @@ ol.WEBGL_EXTENSIONS; // value is set in `ol.has`
|
||||
ol.inherits =
|
||||
goog.inherits;
|
||||
// note that the newline above is necessary to satisfy the linter
|
||||
|
||||
|
||||
/**
|
||||
* Determine if a value is defined.
|
||||
* @param {?} value The value to test.
|
||||
* @return {boolean} The value is defined.
|
||||
*/
|
||||
ol.isDef = function(value) {
|
||||
return value !== undefined;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user