Jahzzman / svgpan

Automatically exported from code.google.com/p/svgpan
0 stars 0 forks source link

Block dezoom at 100% #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, thanks for your script, SVGPan makes my life easier!
Anyway, I use it for an interactive story with a lot of illustrations, and at a 
point, I wanted block the dezoom at 100% (like this, the svg is never smaller 
that its original size).

I did it by replacing the line 145 (the setCTM function) by this one:

var s = "matrix(" + Math.max(1,matrix.a) + "," + matrix.b + "," + matrix.c + 
"," + Math.max(1,matrix.d) + "," + Math.min(0,matrix.e) + "," + 
Math.min(0,matrix.f) + ")";

I don't know if it's the better way, I'm kind of newbie in javascript, but if 
someone else need it, it can be useful :)

Original issue reported on code.google.com by cil...@gmail.com on 26 May 2013 at 11:00