Ticket #1579 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Draw bug in OpenLayers.Handler.Box with firefox

Reported by: openlayers Owned by:
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 Download (0.6 KB) - added by openlayers 5 years ago.
Patch to box handler
1579-r7374-A0.patch Download (1.1 KB) - added by ahocevar 5 years ago.
a minor modification of the original patch, should increase performance

Change History

Changed 5 years ago by openlayers

Patch to box handler

Changed 5 years ago by ahocevar

a minor modification of the original patch, should increase performance

Changed 5 years ago 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.

Changed 5 years ago by ahocevar

  • keywords Draw firefox removed
  • 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)

Note: See TracTickets for help on using tickets.