OpenLayers OpenLayers

Ticket #1579 (closed bug: fixed)

Opened 6 months ago

Last modified 6 months ago

Draw bug in OpenLayers.Handler.Box with firefox

Reported by: openlayers Assigned to:
Priority: minor Milestone: 2.7 Release
Component: Handler.Box Version: 2.6
Keywords: Cc:
State: Complete

Description

Hi. I've found a problem in OpenLayers.Handler.Box; when you draw a box and move fast from negative to positive coordinates in firefox, the mouse cursor do not follow exactly the box. The code that give problem is :

if (xy.x < this.dragHandler.start.x) {

this.zoomBox.style.left = xy.x+"px";

} if (xy.y < this.dragHandler.start.y) {

this.zoomBox.style.top = xy.y+"px";

}

if you move the mouse very fast, firefox lose some events and the top/left value remain with old values also if i go in positive area.

Patch file attached.

Attachments

Box.js.patch (0.6 kB) - added by openlayers on 06/09/08 04:27:11.
Patch to box handler
1579-r7374-A0.patch (1.1 kB) - added by ahocevar on 06/18/08 05:30:06.
a minor modification of the original patch, should increase performance

Change History

06/09/08 04:27:11 changed by openlayers

  • attachment Box.js.patch added.

Patch to box handler

06/18/08 05:30:06 changed by ahocevar

  • attachment 1579-r7374-A0.patch added.

a minor modification of the original patch, should increase performance

06/18/08 05:31:50 changed by ahocevar

  • state set to Commit.
  • milestone set to 2.7 Release.

Thanks for the patch, I can confirm that this fixes the issue. I created a modified version which should increase performance.

06/18/08 05:33:55 changed by ahocevar

  • keywords deleted.
  • status changed from new to closed.
  • state changed from Commit to Complete.
  • resolution set to fixed.

(In [7375]) "Draw bug in OpenLayers.Handler.Box with firefox". Now always set style.left and style.top, so lost events won't result in an incorrect box any more. r=me (closes #1579)