On 22.08.2011 01:42, Richard Sanders wrote: >> From your code I can't see a direct evidence that this is any better >> than not adding 1. I do agree though that there are small differences >> in the drawing results between Windows and Linux. > > Not adding 1 results in a smaller diameter circle (by 2 pixels) being > drawn. If I just wanted to draw a circle it probably would not matter. > In this case the diameter of the circle does matter as it has to fit > with other drawn stuff
Yes, I knew what you mean, but I still can't *see* it. It would help much if you could provide a complete and compileable example program for this issue (source code). >>> Other funnies I have found >>> >>> #ifndef WIN32 >>> fl_pie(c_x - r, c_y - r, r + r + 1, r + r + 1, 315, 225); >>> #else >>> fl_pie(c_x - r, c_y - r, r + r , r + r, 225, 315); >>> #endif ... >>> Also note that for the desired portion of the arc to be drawn it is >>> necessary for the start and end point degrees to be reversed. >> >> Here you're definitely wrong. Please see the docs of fl_pie(): >> "a1,a2 start and end angles of arc measured in degrees counter- >> clockwise from 3 o'clock. a2 must be greater than or equal to a1." > > > I may be wrong but this code is taken from a working program for Linux > and Windows. The "a1, a2" had to be reversed as I mentioned above. I > did not do the reversal for fun. I didn't say that. But you were probably misled by your testing and the existing (let me guess: Linux) code. Please see below for more. > As they say the proof of the pudding > is in the eating. Unfortunately this is not true for programming as well. Please try to reverse the arguments in the first line of your code above (the Linux version) and tell us what you see then. Does it still work? I'm sure it will (I just tested this with the unittests example, and it worked for me). So, although your code is /wrong/ according to the docs!, it does what you /expect/ on Linux, but this doesn't prove that the code is correct. That's what is called *undefined* behaviour. And if you'd change the first line, then there wouldn't be any platform-specific differences any more (no reversal of arguments a1, a2). Albrecht _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

