diff --git a/prot2/Matriz.pde b/prot2/Matriz.pde index ee78ee6..241ace8 100644 --- a/prot2/Matriz.pde +++ b/prot2/Matriz.pde @@ -128,8 +128,8 @@ class Matriz { } // Preenche fantasmas - if(maioresValoresLocaisY[i] == 0.0) maioresValoresLocaisY[i] = 2.0; - if(maioresValoresLocaisX[i] == 0.0) maioresValoresLocaisX[i] = 2.0; + if(maioresValoresLocaisY[i] == 0.0) maioresValoresLocaisY[i] = 1.5; + if(maioresValoresLocaisX[i] == 0.0) maioresValoresLocaisX[i] = 1.5; // Contando os inválidos if(this.quadrados[numChave-1][i] == null) countNulls++; @@ -161,16 +161,14 @@ class Matriz { comp += maioresValoresLocaisY[i]; altura += maioresValoresLocaisX[numChave-i-1]; } - constanteY = novoH/altura; - constanteX = novoW/comp; + constanteY = (true) ? novoH/altura : h/altura; + constanteX = (true) ? novoW/comp : w/altura; for(int i=numChave-1; i>=countNulls; i--) { float acumulaX = 0; for(int k=countNulls; k