https://bugs.winehq.org/show_bug.cgi?id=52492
--- Comment #10 from Rob F rjfeuerbach@gmail.com ---
@Rob F
May I ask what exactly you did?
Also, could I get permission to include your tests when I try to submit that as a fix?
Certainly -- please feel free to incorporate the tests that were originally submitted. The problem was the limited precision of the floating-point calculations can result in the equality-test failing.
The patch I have been using locally replaces the equality test with a taxi-cab distance check of the closeness between the end-points and mid-point against flatness:
.... mp[2].X = (mp[1].X + mp[3].X) / 2.0; mp[2].Y = (mp[1].Y + mp[3].Y) / 2.0;
pt = end->pt; pt_st = start->pt; /* test for closely spaced points to avoid limited-precision errors in flatness check */ if((fabs(pt.X - mp[2].X) + fabs(pt.Y - mp[2].Y) + fabs(pt_st.X - mp[2].X) + fabs(pt_st.Y - mp[2].Y) ) <= flatness) return TRUE;
/* check flatness as a half of distance between middle point and a linearized path */ ....
There are other places in the wine codebase (opengl32/wgl.c:bezier_approximate is one) that do something similar.