Replace some floating point expressions with equivalent integer ones

This commit is contained in:
Paul Cornett
2020-09-18 12:10:40 -07:00
parent 7298070ab0
commit 7d11dd20d4
3 changed files with 17 additions and 17 deletions

View File

@@ -211,7 +211,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
value = (edgePos * percent) / 100 + margin;
done = true;
return true;
}
@@ -286,7 +286,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) - margin);
value = (edgePos * percent) / 100 - margin;
done = true;
return true;
}
@@ -364,7 +364,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
value = (edgePos * percent) / 100 + margin;
done = true;
return true;
}
@@ -439,7 +439,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) - margin);
value = (edgePos * percent) / 100 - margin;
done = true;
return true;
}
@@ -517,7 +517,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
value = (edgePos * percent) / 100 + margin;
done = true;
return true;
}
@@ -585,7 +585,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
value = (edgePos * percent) / 100 + margin;
done = true;
return true;
}
@@ -626,7 +626,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01));
value = (edgePos * percent) / 100;
done = true;
return true;
}
@@ -684,7 +684,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr
int edgePos = GetEdge(otherEdge, win, otherWin);
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01));
value = (edgePos * percent) / 100;
done = true;
return true;
}