mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Merge pull request #8473 from mbrzakovic/8472-crossEditableZoom
CrossEditableZoom event firing fix - Use fresh zoom level value to determine if event should be fired
This commit is contained in:
@@ -589,15 +589,6 @@ export function rendererMap(context) {
|
||||
return; // no change
|
||||
}
|
||||
|
||||
var withinEditableZoom = map.withinEditableZoom();
|
||||
if (_lastWithinEditableZoom !== withinEditableZoom) {
|
||||
if (_lastWithinEditableZoom !== undefined) {
|
||||
// notify that the map zoomed in or out over the editable zoom threshold
|
||||
dispatch.call('crossEditableZoom', this, withinEditableZoom);
|
||||
}
|
||||
_lastWithinEditableZoom = withinEditableZoom;
|
||||
}
|
||||
|
||||
if (geoScaleToZoom(k, TILESIZE) < _minzoom) {
|
||||
surface.interrupt();
|
||||
dispatch.call('hitMinZoom', this, map);
|
||||
@@ -608,6 +599,15 @@ export function rendererMap(context) {
|
||||
}
|
||||
|
||||
projection.transform(eventTransform);
|
||||
|
||||
var withinEditableZoom = map.withinEditableZoom();
|
||||
if (_lastWithinEditableZoom !== withinEditableZoom) {
|
||||
if (_lastWithinEditableZoom !== undefined) {
|
||||
// notify that the map zoomed in or out over the editable zoom threshold
|
||||
dispatch.call('crossEditableZoom', this, withinEditableZoom);
|
||||
}
|
||||
_lastWithinEditableZoom = withinEditableZoom;
|
||||
}
|
||||
|
||||
var scale = k / _transformStart.k;
|
||||
var tX = (x / scale - _transformStart.x) * scale;
|
||||
|
||||
Reference in New Issue
Block a user