mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Update d3, eliminate workaround. Thx @mbostock!
This commit is contained in:
+3
-22
@@ -380,13 +380,9 @@ iD.Map = function(elem, connection) {
|
||||
|
||||
function zoomPan() {
|
||||
var fast = (d3.event.scale === projection.scale());
|
||||
if (d3.event && d3.event.sourceEvent.type === "dblclick") {
|
||||
dblclick.call(this);
|
||||
} else {
|
||||
projection
|
||||
.translate(d3.event.translate)
|
||||
.scale(d3.event.scale);
|
||||
}
|
||||
projection
|
||||
.translate(d3.event.translate)
|
||||
.scale(d3.event.scale);
|
||||
if (fast) {
|
||||
if (!translateStart) translateStart = d3.event.translate.slice();
|
||||
var a = d3.event.translate,
|
||||
@@ -399,21 +395,6 @@ iD.Map = function(elem, connection) {
|
||||
}
|
||||
}
|
||||
|
||||
function dblclick() {
|
||||
var p = d3.mouse(this),
|
||||
translate = projection.translate(),
|
||||
scale0 = projection.scale(),
|
||||
scale1 = Math.pow(2, Math.floor(Math.log(scale0) / Math.LN2) + 1);
|
||||
projection.scale(scale1).translate([
|
||||
p[0] - (p[0] - translate[0]) / scale0 * scale1,
|
||||
p[1] - (p[1] - translate[1]) / scale0 * scale1
|
||||
]);
|
||||
zoom.scale(scale1).translate([
|
||||
p[0] - (p[0] - translate[0]) / scale0 * scale1,
|
||||
p[1] - (p[1] - translate[1]) / scale0 * scale1
|
||||
]);
|
||||
}
|
||||
|
||||
surface.on('mouseup', function() {
|
||||
if (surface.style(transformProp)) {
|
||||
translateStart = null;
|
||||
|
||||
Vendored
+4
-7604
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user