Use ol.math.clamp()

This commit is contained in:
Tim Schaub
2015-09-27 09:54:11 -06:00
parent 5cac9d61cc
commit f746cb7f57
12 changed files with 67 additions and 30 deletions
+3 -3
View File
@@ -2,10 +2,10 @@ goog.provide('ol.layer.Base');
goog.provide('ol.layer.LayerProperty');
goog.provide('ol.layer.LayerState');
goog.require('goog.math');
goog.require('goog.object');
goog.require('ol');
goog.require('ol.Object');
goog.require('ol.math');
goog.require('ol.source.State');
@@ -141,10 +141,10 @@ ol.layer.Base.prototype.getLayerState = function() {
var minResolution = this.getMinResolution();
return {
layer: /** @type {ol.layer.Layer} */ (this),
brightness: goog.math.clamp(brightness, -1, 1),
brightness: ol.math.clamp(brightness, -1, 1),
contrast: Math.max(contrast, 0),
hue: hue,
opacity: goog.math.clamp(opacity, 0, 1),
opacity: ol.math.clamp(opacity, 0, 1),
saturation: Math.max(saturation, 0),
sourceState: sourceState,
visible: visible,