diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d7de0153..e1bcb5132 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :sparkles: Usability & Accessibility * Show full relation label as hover-text in _membership editor_, disambiguate relations with duplicate labels by appending the relation id ([#10492]) +* More consistently round non-integer initial zoom when zooming in/out when using the zoom buttons or `+`/`-` keyboard shortcuts #### :scissors: Operations * Preserve the sum of certain tags (`step_count`, `parking:*:capacity`) during _join_ operation ([#10492], thanks [@ChaitanyaKadu03]) * Preserve total value of `parking:*:capacity` tags during _split_ operation by distributing it proportionally to the resulting ways ([#10492]) diff --git a/modules/renderer/map.js b/modules/renderer/map.js index b5d71a369..6141f24ba 100644 --- a/modules/renderer/map.js +++ b/modules/renderer/map.js @@ -825,11 +825,11 @@ export function rendererMap(context) { function zoomIn(delta) { - setCenterZoom(map.center(), ~~map.zoom() + delta, 250, true); + setCenterZoom(map.center(), Math.trunc(map.zoom() + 0.45) + delta, 150, true); } function zoomOut(delta) { - setCenterZoom(map.center(), ~~map.zoom() - delta, 250, true); + setCenterZoom(map.center(), Math.ceil(map.zoom() - 0.45) - delta, 150, true); } map.zoomIn = function() { zoomIn(1); };