snap.svg.zpd icon indicating copy to clipboard operation
snap.svg.zpd copied to clipboard

Zooming threshold code

Open jlgrall opened this issue 10 years ago • 2 comments

In your threshold code, you refuse values that exceed the threshold:

if (matrix.d >= threshold[1]) {
  return;
}

This code can cause problems if:

  • the mousewheel increases the zoom with large steps. For example: start=0, step=30, max=59. You will never get close to 59, you will be limited to 30.
  • if I programmatically directly modify the transform attribute to apply a zoom that goes over the threshold, then I cannot zoom back with the mousewheel, it will be completely blocked.
  • if you rotate the view, then matrix.d will not be your zoom factor anymore, which makes all your computations wrong. See matrix descriptions in: http://www.w3.org/TR/SVG/coords.html#EstablishingANewUserSpace

jlgrall avatar Nov 30 '14 04:11 jlgrall

@jlgrall You are right on this. We need a better try to handle zoom threshold.

hueitan avatar May 11 '15 04:05 hueitan

Any good idea for this @jlgrall ?

hueitan avatar Jun 11 '15 03:06 hueitan