This commit is contained in:
vazome 2025-06-19 11:21:24 +04:00
parent 7413f2a479
commit dc5602504e
No known key found for this signature in database

View File

@ -127,18 +127,18 @@ class DiagramPanZoom {
private resetTransform() { private resetTransform() {
this.scale = 1 this.scale = 1
// Get container and SVG dimensions // Get container and SVG dimensions
const containerRect = this.container.getBoundingClientRect() const containerRect = this.container.getBoundingClientRect()
const svg = this.content.querySelector("svg")! const svg = this.content.querySelector("svg")!
const svgRect = svg.getBoundingClientRect() const svgRect = svg.getBoundingClientRect()
// Calculate center position relative to container // Calculate center position relative to container
this.currentPan = { this.currentPan = {
x: (containerRect.width - svgRect.width) / 2, x: (containerRect.width - svgRect.width) / 2,
y: (containerRect.height - svgRect.height) / 2, y: (containerRect.height - svgRect.height) / 2,
} }
this.updateTransform() this.updateTransform()
} }
} }