better doc strings for the pixelTolerance option of Handler.Point, plus code styling, no functional change
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11747 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -98,11 +98,11 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: pixelTolerance
|
* APIProperty: pixelTolerance
|
||||||
* {Number} Maximum number of pixels between mouseup and mousedown for an
|
* {Number} Maximum number of pixels between down and up (mousedown
|
||||||
* event to be considered a click. Default is 5. If set to an
|
* and mouseup, or touchstart and touchend) for the handler to
|
||||||
* integer value, clicks with a drag greater than the value will be
|
* add a new point. If set to an integer value, if the
|
||||||
* ignored. This property can only be set when the handler is
|
* displacement between down and up is great to this value
|
||||||
* constructed.
|
* no point will be added. Default value is 5.
|
||||||
*/
|
*/
|
||||||
pixelTolerance: 5,
|
pixelTolerance: 5,
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
|||||||
this.last = evt.xy;
|
this.last = evt.xy;
|
||||||
|
|
||||||
if (this.timerId &&
|
if (this.timerId &&
|
||||||
this.passesTolerance(last, evt.xy, this.dblclickTolerance)) {
|
this.passesTolerance(last, evt.xy, this.dblclickTolerance)) {
|
||||||
this.isDblclick = true;
|
this.isDblclick = true;
|
||||||
// a valid touch immediately adds a component and leaves us with a
|
// a valid touch immediately adds a component and leaves us with a
|
||||||
// complete geometry
|
// complete geometry
|
||||||
@@ -521,7 +521,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
|||||||
down: function(evt) {
|
down: function(evt) {
|
||||||
this.mouseDown = true;
|
this.mouseDown = true;
|
||||||
this.lastDown = evt.xy;
|
this.lastDown = evt.xy;
|
||||||
if (!this.touch) {
|
if(!this.touch) { // no point displayed until up on touch devices
|
||||||
this.modifyFeature(evt.xy);
|
this.modifyFeature(evt.xy);
|
||||||
}
|
}
|
||||||
this.stoppedDown = this.stopDown;
|
this.stoppedDown = this.stopDown;
|
||||||
@@ -540,7 +540,8 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
|||||||
* {Boolean} Allow event propagation
|
* {Boolean} Allow event propagation
|
||||||
*/
|
*/
|
||||||
move: function (evt) {
|
move: function (evt) {
|
||||||
if(!this.touch && (!this.mouseDown || this.stoppedDown)) {
|
if(!this.touch // no point displayed until up on touch devices
|
||||||
|
&& (!this.mouseDown || this.stoppedDown)) {
|
||||||
this.modifyFeature(evt.xy);
|
this.modifyFeature(evt.xy);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -567,11 +568,11 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
|||||||
}
|
}
|
||||||
// ignore double-clicks
|
// ignore double-clicks
|
||||||
if (this.lastUp && this.passesTolerance(this.lastUp, evt.xy,
|
if (this.lastUp && this.passesTolerance(this.lastUp, evt.xy,
|
||||||
this.dblclickTolerance)) {
|
this.dblclickTolerance)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (this.lastDown && this.passesTolerance(this.lastDown, evt.xy,
|
if (this.lastDown && this.passesTolerance(this.lastDown, evt.xy,
|
||||||
this.pixelTolerance)) {
|
this.pixelTolerance)) {
|
||||||
if (this.touch) {
|
if (this.touch) {
|
||||||
this.modifyFeature(evt.xy);
|
this.modifyFeature(evt.xy);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user