Team:Grenoble/script
From 2012.igem.org
(Difference between revisions)
Line 100: | Line 100: | ||
} | } | ||
}; | }; | ||
- | + | this.next() | |
+ | } | ||
+ | |||
+ | function A(c,a,b){ | ||
+ | var d,e,f,j,k,l,i,g,h; | ||
+ | b=b||{}; | ||
+ | d=b.max_w; | ||
+ | e=b.min_w; | ||
+ | f=b.max_h; | ||
+ | j=b.max_h; | ||
+ | k=b.round===undefined?1:b.round; | ||
+ | l=c/a; | ||
+ | i=a/c; | ||
+ | g=a; | ||
+ | h=c; | ||
+ | if(h<e){ | ||
+ | h=e; | ||
+ | g=h*i | ||
+ | } | ||
+ | if(g<j){ | ||
+ | g=j; | ||
+ | h=g*l | ||
+ | } | ||
+ | if(d&&(h>d)){ | ||
+ | h=d; | ||
+ | g=h*i | ||
+ | } | ||
+ | if(f&&(g>f)){ | ||
+ | g=f; | ||
+ | h=g*l | ||
+ | } | ||
+ | h=h<0?0:h; | ||
+ | g=g<0?0:g; | ||
+ | return{w:k?Math.round(h):h,h:k?Math.round(g):g} | ||
+ | } | ||
} | } | ||
Revision as of 09:16, 12 July 2012