71,22 → 71,25 |
} |
|
public void setTailleOptimale() { |
|
double fenetreH = Window.getClientHeight(); |
double fenetreW = Window.getClientWidth(); |
|
double rapport = 0; |
|
double photoH = photoPrincipale.getHeight(); |
double photoW = photoPrincipale.getWidth(); |
|
double rapport = 0; |
double reduction = 150; |
|
if(photoH >= (fenetreH - reduction) || photoW >= (fenetreW - reduction)) { |
if(photoH > photoW) { |
if(photoH > (fenetreH - reduction) || photoW > (fenetreW - reduction)) { |
|
if(photoH >= (fenetreH - reduction)) { |
rapport = photoW/photoH; |
photoH = fenetreH-reduction; |
photoW = photoH*rapport; |
} else { |
} |
|
if(photoW >= (fenetreW - reduction)) { |
rapport = photoH/photoW; |
photoW = fenetreW-reduction; |
photoH = photoW*rapport; |