bumbu/svg-pan-zoom

minZoom and maxZoom not updated when updateBBox( ) is called

Open

#267 opened on Oct 26, 2017

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (1,585 stars) (383 forks)batch import
bughelp wanted

Description

Expected behaviour

When adding new elements to the SVG that fall outside the current BBox, and calling updateBBox(), i should be able to zoom out to see those elements

Actual behaviour

The amount that I can zoom out is still based on the original BBox, meaning that i may not be able to zoom out to see all elements, even if minZoom is <1

Steps to reproduce the behaviour

  1. activate the lib on an SVG with minZoom: 1
  2. add elements outside the SVG's outer edge
  3. call updateBBox()
  4. try to zoom out to see the new elements

Note: Although it feels a bit weird to have them diverge, I'm not sure that the maximum zoom level should be affected by removing elements in the same way -- it would feel kinda strange to not be able to zoom into existing elements just because new ones have been added

Contributor guide