OpenLayers OpenLayers

Changeset 5698

Show
Ignore:
Timestamp:
01/09/08 04:55:22 (1 year ago)
Author:
tschaub
Message:

The pixelTolerance check on the click handler only works if mousedown events get to the handler. This keeps the handler from failing in cases where mousedown is stopped and pixelTolerance is set. r=crschmidt (closes #1246)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Handler/Click.js

    r5676 r5698  
    172172    /** 
    173173     * Method: passesTolerance 
    174      * Determine whether the event is within the optional pixel tolerance. 
     174     * Determine whether the event is within the optional pixel tolerance.  Note 
     175     *     that the pixel tolerance check only works if mousedown events get to 
     176     *     the listeners registered here.  If they are stopped by other elements, 
     177     *     the <pixelTolerance> will have no effect here (this method will always 
     178     *     return true). 
    175179     * 
    176180     * Returns: 
     
    179183    passesTolerance: function(evt) { 
    180184        var passes = true; 
    181         if(this.pixelTolerance) { 
     185        if(this.pixelTolerance && this.down) { 
    182186            var dpx = Math.sqrt( 
    183187                Math.pow(this.down.x - evt.xy.x, 2) +