Problem with Thickness
Heres my problem I am making this paint program and I have been stuck on getting my method to thicken the lines, circles, ect. but everytime i click the button i get a different random thickness it seems. For instance, I will click it the first time to set thickness from 1 to 2 but i will go from 1 to 3 and then click again and go to 2. I am pretty sure my coding sould work correctly for this point but its not any suggestions how to rewrite it or improve on it.
I will explane what each variable is
publicvoid howmanytime()
{
if(clicked ==true)// boolean value that is made true when thickness button is clicked
if(Tc == 1)// sees if Tc is equal to 1
Tc = 2;// If it is equal to 1 sets Tc as 2
elseif(Tc == 2)// and so on
Tc = 3;
elseif(Tc == 3)
Tc = 1;
thickness();// Calls next methos to add values to arrays and change thickness
}
publicvoid thickness()
{
clicked =false;// boolean that is used in method before to give Tc the value
switch(Tc)// Tc chosses thicknesses
{
case 1:// sees is Tc is equal to 1
thick = 1.0f;// Sets thick float value to 1.0
if(rect ==true)// Checks to see if boolean rect (making a rectangle draw) is true
tr[trc] = 1.0f;// Setting tr's, a float array, trc, a int value to specific what float value to change, to 1.0
elseif(circle ==true)// and so on and so on
to[toc] = 1.0f;
elseif(line ==true)
tl[tlc] = 1.0f;
elseif(pix ==true)
tp[tpc] = 1.0f;
break;
case 2:
thick = 2.0f;
if(rect ==true)
tr[trc] = 2.0f;
elseif(circle ==true)
to[toc] = 2.0f;
elseif(line ==true)
tl[tlc] = 2.0f;
elseif(pix ==true)
tp[tpc] = 2.0f;
break;
case 3:
thick = 3.0f;
if(rect ==true)
tr[trc] = 3.0f;
elseif(circle ==true)
to[toc] = 3.0f;
elseif(line ==true)
tl[tlc] = 3.0f;
elseif(pix ==true)
tp[tpc] = 3.0f;
break;
}
}

