refactor(core): clamp invalid zoom values
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -83,7 +83,10 @@ onMounted(() => {
|
|||||||
const d3Selection = select(viewportEl.value).call(d3Zoom)
|
const d3Selection = select(viewportEl.value).call(d3Zoom)
|
||||||
const d3ZoomHandler = d3Selection.on('wheel.zoom')
|
const d3ZoomHandler = d3Selection.on('wheel.zoom')
|
||||||
|
|
||||||
const updatedTransform = zoomIdentity.translate(defaultPosition[0], defaultPosition[1]).scale(defaultZoom)
|
const updatedTransform = zoomIdentity
|
||||||
|
.translate(defaultViewport.x, defaultViewport.y)
|
||||||
|
.scale(clamp(defaultViewport.zoom, minZoom, maxZoom))
|
||||||
|
|
||||||
const extent: CoordinateExtent = [
|
const extent: CoordinateExtent = [
|
||||||
[0, 0],
|
[0, 0],
|
||||||
[bbox.width, bbox.height],
|
[bbox.width, bbox.height],
|
||||||
|
|||||||
Reference in New Issue
Block a user