Team:Grenoble/script

From 2012.igem.org

(Difference between revisions)
Line 104: Line 104:
      
      
     function A(c,a,b){
     function A(c,a,b){
-
    var d,e,f,j,k,l,i,g,h;
+
    var d,e,f,j,k,l,i,g,h;
-
    b=b||{};
+
    b=b||{};
-
    d=b.max_w;
+
    d=b.max_w;
-
    e=b.min_w;
+
    e=b.min_w;
-
    f=b.max_h;
+
    f=b.max_h;
-
    j=b.max_h;
+
    j=b.max_h;
-
    k=b.round===undefined?1:b.round;
+
    k=b.round===undefined?1:b.round;
-
    l=c/a;
+
    l=c/a;
-
    i=a/c;
+
    i=a/c;
-
    g=a;
+
    g=a;
-
    h=c;
+
    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:27, 12 July 2012