Replace some floating point expressions with equivalent integer ones
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user