From 5ff2fcacb867c6697b7d591222fd86b57eb031ce Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 27 Jan 2014 14:39:40 +0100 Subject: [PATCH] Snap rotation when within 5 degrees instead of 0.1 radians --- src/ol/rotationconstraint.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ol/rotationconstraint.js b/src/ol/rotationconstraint.js index 820f6cf3c8..0f6e3d2dea 100644 --- a/src/ol/rotationconstraint.js +++ b/src/ol/rotationconstraint.js @@ -1,6 +1,8 @@ goog.provide('ol.RotationConstraint'); goog.provide('ol.RotationConstraintType'); +goog.require('goog.math'); + /** * @typedef {function((number|undefined), number): (number|undefined)} @@ -50,7 +52,7 @@ ol.RotationConstraint.createSnapToN = function(n) { * @return {ol.RotationConstraintType} Rotation constraint. */ ol.RotationConstraint.createSnapToZero = function(opt_tolerance) { - var tolerance = opt_tolerance || 0.1; + var tolerance = opt_tolerance || goog.math.toRadians(5); return ( /** * @param {number|undefined} rotation Rotation.