Remove goog.isDef from attribution.js through color.js (-54 B)
This commit is contained in:
@@ -38,8 +38,7 @@ ol.Attribution = function(options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, Array.<ol.TileRange>>}
|
* @type {Object.<string, Array.<ol.TileRange>>}
|
||||||
*/
|
*/
|
||||||
this.tileRanges_ = goog.isDef(options.tileRanges) ?
|
this.tileRanges_ = options.tileRanges ? options.tileRanges : null;
|
||||||
options.tileRanges : null;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ ol.CenterConstraint.createExtent = function(extent) {
|
|||||||
* @return {ol.Coordinate|undefined} Center.
|
* @return {ol.Coordinate|undefined} Center.
|
||||||
*/
|
*/
|
||||||
function(center) {
|
function(center) {
|
||||||
if (goog.isDef(center)) {
|
if (center) {
|
||||||
return [
|
return [
|
||||||
goog.math.clamp(center[0], extent[0], extent[2]),
|
goog.math.clamp(center[0], extent[0], extent[2]),
|
||||||
goog.math.clamp(center[1], extent[1], extent[3])
|
goog.math.clamp(center[1], extent[1], extent[3])
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ ol.Collection = function(opt_array) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {!Array.<T>}
|
* @type {!Array.<T>}
|
||||||
*/
|
*/
|
||||||
this.array_ = goog.isDef(opt_array) ? opt_array : [];
|
this.array_ = opt_array ? opt_array : [];
|
||||||
|
|
||||||
this.updateLength_();
|
this.updateLength_();
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ ol.color.rgbaColorRe_ =
|
|||||||
ol.color.blend = function(dst, src, opt_color) {
|
ol.color.blend = function(dst, src, opt_color) {
|
||||||
// http://en.wikipedia.org/wiki/Alpha_compositing
|
// http://en.wikipedia.org/wiki/Alpha_compositing
|
||||||
// FIXME do we need to scale by 255?
|
// FIXME do we need to scale by 255?
|
||||||
var out = goog.isDef(opt_color) ? opt_color : [];
|
var out = opt_color ? opt_color : [];
|
||||||
var dstA = dst[3];
|
var dstA = dst[3];
|
||||||
var srcA = src[3];
|
var srcA = src[3];
|
||||||
if (dstA == 1) {
|
if (dstA == 1) {
|
||||||
@@ -271,7 +271,7 @@ ol.color.isValid = function(color) {
|
|||||||
* @return {ol.Color} Clamped color.
|
* @return {ol.Color} Clamped color.
|
||||||
*/
|
*/
|
||||||
ol.color.normalize = function(color, opt_color) {
|
ol.color.normalize = function(color, opt_color) {
|
||||||
var result = goog.isDef(opt_color) ? opt_color : [];
|
var result = opt_color ? opt_color : [];
|
||||||
result[0] = goog.math.clamp((color[0] + 0.5) | 0, 0, 255);
|
result[0] = goog.math.clamp((color[0] + 0.5) | 0, 0, 255);
|
||||||
result[1] = goog.math.clamp((color[1] + 0.5) | 0, 0, 255);
|
result[1] = goog.math.clamp((color[1] + 0.5) | 0, 0, 255);
|
||||||
result[2] = goog.math.clamp((color[2] + 0.5) | 0, 0, 255);
|
result[2] = goog.math.clamp((color[2] + 0.5) | 0, 0, 255);
|
||||||
@@ -309,7 +309,7 @@ ol.color.toString = function(color) {
|
|||||||
* @return {ol.Color} Transformed color.
|
* @return {ol.Color} Transformed color.
|
||||||
*/
|
*/
|
||||||
ol.color.transform = function(color, transform, opt_color) {
|
ol.color.transform = function(color, transform, opt_color) {
|
||||||
var result = goog.isDef(opt_color) ? opt_color : [];
|
var result = opt_color ? opt_color : [];
|
||||||
result = goog.vec.Mat4.multVec3(transform, color, result);
|
result = goog.vec.Mat4.multVec3(transform, color, result);
|
||||||
goog.asserts.assert(goog.isArray(result), 'result should be an array');
|
goog.asserts.assert(goog.isArray(result), 'result should be an array');
|
||||||
result[3] = color[3];
|
result[3] = color[3];
|
||||||
|
|||||||
Reference in New Issue
Block a user