Skip to content

Commit

Permalink
Fix incorrect division of two numbers by integer, should use double
Browse files Browse the repository at this point in the history
Change the division operation from integer type to double
  • Loading branch information
jules-ai authored Jan 24, 2025
1 parent b23b55b commit 5bb37db
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 5bb37db

Please sign in to comment.