Allow comparison of null stroke styles

This commit is contained in:
Tom Payne
2013-11-07 19:42:20 +01:00
parent 15583865b6
commit 7e81cbae08
+3 -2
View File
@@ -30,12 +30,13 @@ ol.style.Stroke;
/** /**
* @param {ol.style.Stroke} strokeStyle1 Stroke style 1. * @param {?ol.style.Stroke} strokeStyle1 Stroke style 1.
* @param {ol.style.Stroke} strokeStyle2 Stroke style 2. * @param {?ol.style.Stroke} strokeStyle2 Stroke style 2.
* @return {boolean} Equals. * @return {boolean} Equals.
*/ */
ol.style.stroke.equals = function(strokeStyle1, strokeStyle2) { ol.style.stroke.equals = function(strokeStyle1, strokeStyle2) {
return strokeStyle1 === strokeStyle2 || ( return strokeStyle1 === strokeStyle2 || (
!goog.isNull(strokeStyle1) && !goog.isNull(strokeStyle2) &&
strokeStyle1.color == strokeStyle2.color && strokeStyle1.color == strokeStyle2.color &&
strokeStyle1.width == strokeStyle2.width); strokeStyle1.width == strokeStyle2.width);
}; };