Skip to content

Commit

Permalink
Merge pull request #3173 from jules-ai/fix_int_div
Browse files Browse the repository at this point in the history
Fix incorrect division of two numbers by integer, should use double
  • Loading branch information
jxt1234 authored Jan 24, 2025
2 parents b23b55b + 5bb37db commit 5bd7ffc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/cv/source/imgproc/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ static void EllipseEx(std::vector<Region>& regions, Size size, Point2l center, S
for (unsigned int i = 0; i < _v.size(); ++i)
{
Point2l pt;
pt.x = (int64_t)std::round(_v[i].x / XY_ONE) << XY_SHIFT;
pt.y = (int64_t)std::round(_v[i].y / XY_ONE) << XY_SHIFT;
pt.x = (int64_t)std::round(_v[i].x / static_cast<double>(XY_ONE)) << XY_SHIFT;
pt.y = (int64_t)std::round(_v[i].y / static_cast<double>(XY_ONE)) << XY_SHIFT;
pt.x += std::round(_v[i].x - pt.x);
pt.y += std::round(_v[i].y - pt.y);
if (pt != prevPt) {
Expand Down

0 comments on commit 5bd7ffc

Please sign in to comment.