Snap rotation when within 5 degrees instead of 0.1 radians

This commit is contained in:
Tom Payne
2014-01-27 14:39:40 +01:00
parent 1b35d0afbb
commit 5ff2fcacb8

View File

@@ -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.