On Sun, 21 Aug 2011 14:46:57 -0700, Albrecht Schlosser
<[email protected]> wrote:
>>> Here is an example
>>>
>>> static void DrawRod(int x, int y, int d)
>>> {
>>> int r = d>> 1;
>>> fl_color(FL_RED);
>>> #ifdef WIN32
>>> fl_pie(x, y, d, d, 0, 360);
>>> #else
>>> fl_pie(x, y, d + 1, d + 1, 0, 360);
>>> #endif
>>> fl_color(FL_BLACK);
>>> fl_circle(x + r, y + r, r);
>>> }
>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
>> 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
>>
>> Notice that the radius has to be increased by 1 for X11.
>
>See above.
>
>> 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. As they say the proof of the pudding
is in the eating.
You can download the (pudding) program here.
http://members.shaw.ca/lnr729/shopcalc/WorkshopCalulator.html
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk