Use fabs() instead of abs() for non-integer variables in SVG DC
::abs() truncates floating point values to ints, so use fabs() instead. This
could have been also corrected by using std::abs(), which is overloaded for
multiple types, but use fabs() for consistency with the existing code.
This fixes a problem introduced in 1e0719ad81
.
See #17557.
This commit is contained in:
@@ -845,14 +845,14 @@ void wxSVGFileDCImpl::DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord
|
|||||||
double start = (sa - 90);
|
double start = (sa - 90);
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
start += 360;
|
start += 360;
|
||||||
while (abs(start) > 360)
|
while (fabs(start) > 360)
|
||||||
start -= (start / abs(start)) * 360;
|
start -= (start / fabs(start)) * 360;
|
||||||
|
|
||||||
double end = (ea - 90);
|
double end = (ea - 90);
|
||||||
if (end < 0)
|
if (end < 0)
|
||||||
end += 360;
|
end += 360;
|
||||||
while (abs(end) > 360)
|
while (fabs(end) > 360)
|
||||||
end -= (end / abs(end)) * 360;
|
end -= (end / fabs(end)) * 360;
|
||||||
|
|
||||||
// svg arcs are in clockwise direction, reverse angle
|
// svg arcs are in clockwise direction, reverse angle
|
||||||
double angle = end - start;
|
double angle = end - start;
|
||||||
|
Reference in New Issue
Block a user