Team:Grenoble/script

From 2012.igem.org

(Difference between revisions)
Line 102: Line 102:
         this.next()
         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}
 +
}
 +
})
})
(window,document);
(window,document);

Revision as of 09:26, 12 July 2012