mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Remove setCenter() from map.dimensions()
This was triggering a weird redraw which made the map slow and look wrong The map will redraw again in a few milleseconds anyway. This means that the the map will not stay on the center, but rather the top-left corner, which kind of feels better anyway, as it doesn't move things around as much.
This commit is contained in:
@@ -662,13 +662,11 @@ export function rendererMap(context) {
|
||||
|
||||
map.dimensions = function(_) {
|
||||
if (!arguments.length) return dimensions;
|
||||
var center = map.center();
|
||||
dimensions = _;
|
||||
drawLayers.dimensions(dimensions);
|
||||
context.background().dimensions(dimensions);
|
||||
projection.clipExtent([[0, 0], dimensions]);
|
||||
mouse = utilFastMouse(supersurface.node());
|
||||
setCenter(center);
|
||||
|
||||
scheduleRedraw();
|
||||
return map;
|
||||
|
||||
Reference in New Issue
Block a user