correction erreur

master
frperalde 4 years ago
parent 30d738f109
commit 8c8d303222

@ -292,7 +292,7 @@ class Figure {
formeInte.classList.add('rondv2'); formeInte.classList.add('rondv2');
formeInte.style.backgroundColor = "var(--lighttercia)"; formeInte.style.backgroundColor = "var(--lighttercia)";
formeExte.style.backgroundColor = "var(--colorbase)";
if (this.couleur != null) { if (this.couleur != null) {
if (this.couleur == CouleurFigure.Couleur1){ if (this.couleur == CouleurFigure.Couleur1){
@ -367,33 +367,158 @@ class Figure {
} }
} }
} else { } else {
this.couleur = CouleurFigure.Couleur1;
if (selectionDiemension == 0) { if (selectionDiemension == 0) {
this.couleur = CouleurFigure.Couleur1; this.couleur = CouleurFigure.Couleur1;
if (this.pos == 0 || this.pos == 2 || this.pos == 9 || this.pos == 11) { if (this.pos == 0 || this.pos == 2 || this.pos == 9 || this.pos == 11) {
formeExte.style.backgroundColor = "var(--colorone)"; formeExte.style.backgroundColor = "var(--colorone)";
this.couleur = CouleurFigure.Couleur2; this.couleur = CouleurFigure.Couleur2;
if(FormeSelect.length > 1)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 1 || this.pos == 10) { if (this.pos == 1 || this.pos == 10) {
formeExte.style.backgroundColor = "var(--colortwo)"; formeExte.style.backgroundColor = "var(--colortwo)";
this.couleur = CouleurFigure.Couleur3; this.couleur = CouleurFigure.Couleur3;
if(FormeSelect.length > 2)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[2]);
formeInte.classList.add(FormeSelect[2]);
//verification triangle ou penda
if(FormeSelect[2] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[2] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 4 || this.pos == 7) { if (this.pos == 4 || this.pos == 7) {
formeExte.style.backgroundColor = "var(--colorthree)"; formeExte.style.backgroundColor = "var(--colorthree)";
this.couleur = CouleurFigure.Couleur4; this.couleur = CouleurFigure.Couleur4;
if(FormeSelect.length > 3)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[3]);
formeInte.classList.add(FormeSelect[3]);
//verification triangle ou penda
if(FormeSelect[3] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[3] == "penta"){
formeInte.classList.add("caspentac");
}
} else if (FormeSelect.length > 1){
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
} else if (selectionDiemension == 1) { } else if (selectionDiemension == 1) {
this.couleur = CouleurFigure.Couleur1; this.couleur = CouleurFigure.Couleur1;
if (this.pos == 0 || this.pos == 2 || this.pos == 6 || this.pos == 8) { if (this.pos == 0 || this.pos == 2 || this.pos == 6 || this.pos == 8) {
formeExte.style.backgroundColor = "var(--colorone)"; formeExte.style.backgroundColor = "var(--colorone)";
this.couleur = CouleurFigure.Couleur2; this.couleur = CouleurFigure.Couleur2;
if(FormeSelect.length > 1)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 1 || this.pos == 7) { if (this.pos == 1 || this.pos == 7) {
formeExte.style.backgroundColor = "var(--colortwo)"; formeExte.style.backgroundColor = "var(--colortwo)";
this.couleur = CouleurFigure.Couleur3; this.couleur = CouleurFigure.Couleur3;
if(FormeSelect.length > 2)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[2]);
formeInte.classList.add(FormeSelect[2]);
//verification triangle ou penda
if(FormeSelect[2] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[2] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 4) { if (this.pos == 4) {
formeExte.style.backgroundColor = "var(--colorthree)"; formeExte.style.backgroundColor = "var(--colorthree)";
this.couleur = CouleurFigure.Couleur4; this.couleur = CouleurFigure.Couleur4;
if(FormeSelect.length > 3)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[3]);
formeInte.classList.add(FormeSelect[3]);
//verification triangle ou penda
if(FormeSelect[3] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[3] == "penta"){
formeInte.classList.add("caspentac");
}
} else if (FormeSelect.length > 1){
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
} }
} }
@ -426,6 +551,8 @@ class Figure {
formeInte.className = "formeinte"; formeInte.className = "formeinte";
formeInte.classList.add('rondv2'); formeInte.classList.add('rondv2');
formeInte.style.backgroundColor = "var(--colorbase)";
if (this.couleur != null) { if (this.couleur != null) {
if (this.couleur == CouleurFigure.Couleur1) { if (this.couleur == CouleurFigure.Couleur1) {
formeInte.style.backgroundColor = "var(--colorbase)"; formeInte.style.backgroundColor = "var(--colorbase)";
@ -500,33 +627,158 @@ class Figure {
} }
} }
} else { } else {
this.couleur = CouleurFigure.Couleur1;
if (selectionDiemension == 0) { if (selectionDiemension == 0) {
this.couleur = CouleurFigure.Couleur1; this.couleur = CouleurFigure.Couleur1;
if (this.pos == 0 || this.pos == 2 || this.pos == 9 || this.pos == 11) { if (this.pos == 0 || this.pos == 2 || this.pos == 9 || this.pos == 11) {
formeInte.style.backgroundColor = "var(--colorone)"; formeInte.style.backgroundColor = "var(--colorone)";
this.couleur = CouleurFigure.Couleur2; this.couleur = CouleurFigure.Couleur2;
if(FormeSelect.length > 1)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 1 || this.pos == 10) { if (this.pos == 1 || this.pos == 10) {
formeInte.style.backgroundColor = "var(--colortwo)"; formeInte.style.backgroundColor = "var(--colortwo)";
this.couleur = CouleurFigure.Couleur3; this.couleur = CouleurFigure.Couleur3;
if(FormeSelect.length > 2)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[2]);
formeInte.classList.add(FormeSelect[2]);
//verification triangle ou penda
if(FormeSelect[2] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[2] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 4 || this.pos == 7) { if (this.pos == 4 || this.pos == 7) {
formeInte.style.backgroundColor = "var(--colorthree)"; formeInte.style.backgroundColor = "var(--colorthree)";
this.couleur = CouleurFigure.Couleur4; this.couleur = CouleurFigure.Couleur4;
if(FormeSelect.length > 3)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[3]);
formeInte.classList.add(FormeSelect[3]);
//verification triangle ou penda
if(FormeSelect[3] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[3] == "penta"){
formeInte.classList.add("caspentac");
}
} else if (FormeSelect.length > 1){
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
} else if (selectionDiemension == 1) { } else if (selectionDiemension == 1) {
this.couleur = CouleurFigure.Couleur1; this.couleur = CouleurFigure.Couleur1;
if (this.pos == 0 || this.pos == 2 || this.pos == 6 || this.pos == 8) { if (this.pos == 0 || this.pos == 2 || this.pos == 6 || this.pos == 8) {
formeInte.style.backgroundColor = "var(--colorone)"; formeInte.style.backgroundColor = "var(--colorone)";
this.couleur = CouleurFigure.Couleur2; this.couleur = CouleurFigure.Couleur2;
if(FormeSelect.length > 1)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 1 || this.pos == 7) { if (this.pos == 1 || this.pos == 7) {
formeInte.style.backgroundColor = "var(--colortwo)"; formeInte.style.backgroundColor = "var(--colortwo)";
this.couleur = CouleurFigure.Couleur3; this.couleur = CouleurFigure.Couleur3;
if(FormeSelect.length > 2)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[2]);
formeInte.classList.add(FormeSelect[2]);
//verification triangle ou penda
if(FormeSelect[2] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[2] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
if (this.pos == 4) { if (this.pos == 4) {
formeInte.style.backgroundColor = "var(--colorthree)"; formeInte.style.backgroundColor = "var(--colorthree)";
this.couleur = CouleurFigure.Couleur4; this.couleur = CouleurFigure.Couleur4;
if(FormeSelect.length > 3)
{
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[3]);
formeInte.classList.add(FormeSelect[3]);
//verification triangle ou penda
if(FormeSelect[3] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[3] == "penta"){
formeInte.classList.add("caspentac");
}
} else if (FormeSelect.length > 1){
//suppression formeBase
formeExte.classList.remove('rondv2');
formeInte.classList.remove('rondv2');
//ajout forme
formeExte.classList.add(FormeSelect[1]);
formeInte.classList.add(FormeSelect[1]);
//verification triangle ou penda
if(FormeSelect[1] == "triangle"){
formeInte.classList.add("castrianglec");
}
if(FormeSelect[1] == "penta"){
formeInte.classList.add("caspentac");
}
}
} }
} }
} }

Loading…
Cancel
Save