mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator into urquhart-routes
This commit is contained in:
commit
077248e4d9
1 changed files with 1 additions and 1 deletions
2
main.js
2
main.js
|
|
@ -457,7 +457,7 @@ function handleZoom(isScaleChanged, isPositionChanged) {
|
||||||
|
|
||||||
// Zoom to a specific point
|
// Zoom to a specific point
|
||||||
function zoomTo(x, y, z = 8, d = 2000) {
|
function zoomTo(x, y, z = 8, d = 2000) {
|
||||||
const transform = d3.zoomIdentity.translate(x * -z + graphWidth / 2, y * -z + graphHeight / 2).scale(z);
|
const transform = d3.zoomIdentity.translate(x * -z + svgWidth / 2, y * -z + svgHeight / 2).scale(z);
|
||||||
svg.transition().duration(d).call(zoom.transform, transform);
|
svg.transition().duration(d).call(zoom.transform, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue