So this issue
came up on fltk.discussions regarding the use of fl_arc(), where
three people including myself were probably more confused than we
should have been about why one of the two forms of the fl_arc()
functions wasn't drawing at all.
Normally I would just make the change, but fl_arc() is not a
function I use much, and wanted to make sure in clarifying, I
wasn't missing some other details or drawing contexts, as I think
some of you other developers are more familiar with the internals
of this than I am.
So I'm asking if I missed anything or if there's better wording
needed.
Oh, and the above as a diff:
I think there's another section as well in the "drawing with fltk" where this info might be duplicated, and thus a similar change done there as well.--- a/FL/fl_draw.H
+++ b/FL/fl_draw.H
@@ -634,6 +634,18 @@ inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, doub
/**
Add a series of points to the current path on the arc of a circle.
+ Unlike the integer-coordinate \c fl_arc(x,y,w,h,a1,a2) overload, this
+ function is not a standalone drawing operation. It must be bracketed by
+ matching fl_begin_*() and fl_end_*() calls. Valid path types are
+ \c points, \c line, \c loop, \c polygon, and \c complex_polygon.
+
+ So for example to draw an arc as a line, use fl_begin_line() and fl_end_line() around fl_arc():
+ \code
+ // Draw a 180 degree arc as a line
+ fl_begin_line();
+ fl_arc(200.0, 100.0, 50.0, 0.0, 180.0);
+ fl_end_line();
+ \endcode
The arc is drawn counter-clockwise from 3 o'clock. If \p end is less than
\p start then it draws the arc in a clockwise direction. To draw an arc across
the 3 o'clock line, \p start and \p end can be greater than 360 or less than 0.
@@ -665,6 +677,12 @@ inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, doub
fl_arc(300.0, 100.0, 50.0, 0.0, 180.0);
fl_end_polygon();
\endcode
+
+ \see fl_begin_points(),
+ fl_begin_line(),
+ fl_begin_loop(),
+ fl_begin_polygon(),
+ fl_begin_complex_polygon()
*/
inline void fl_arc(double x, double y, double r, double start, double end) {
fl_graphics_driver->arc(x, y, r, start, end);
So this issue came up on fltk.discussions regarding the use of fl_arc(), where three people including myself were probably more confused than we should have been about why one of the two forms of the fl_arc() functions wasn't drawing at all.
After solving, I offered the confusion could be avoided by a small clarification in the documentation (red highlighted paragraphs below):
Normally I would just make the change, but fl_arc() is not a function I use much, and wanted to make sure in clarifying, I wasn't missing some other details or drawing contexts, as I think some of you other developers are more familiar with the internals of this than I am.
diff --git a/FL/fl_draw.H b/FL/fl_draw.H index e936de5ab..a13814a0e 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -634,6 +634,13 @@ inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, doub /** Add a series of points to the current path on the arc of a circle. + Unlike the fl_arc(int, int, int, int, double, double) overload that uses + integer coordinates, this function is not a standalone drawing operation. + It requires an active path; that is, it must be enclosed by corresponding calls + to `fl_begin_*()` and `fl_end_*()`. + Valid path types are \c points, \c line, \c loop, \c polygon, and \c complex_polygon. + See examples below. + The arc is drawn counter-clockwise from 3 o'clock. If \p end is less than \p start then it draws the arc in a clockwise direction. To draw an arc across the 3 o'clock line, \p start and \p end can be greater than 360 or less than 0.```
I think there's another section as well in the "drawing with fltk" where this info might be duplicated, and thus a similar change done there as well.

I'm generally fine with the suggested changes, and I would also add what Manolo proposed to clarify it even more.
However, I'm not sure if "Valid path types are \c points, \c line, \c loop, \c polygon, and \c complex_polygon" is correct in this context. Can all these path types be combined with arcs ? I'm leaving this open for now.
Another point for better documentation experience (doxygen related): I would change
"Unlike the integer-coordinate \c fl_arc(x,y,w,h,a1,a2) overload"
to
"Unlike the integer-coordinate fl_arc(int, int, int, int, double, double) overload".
Furthermore, the given example is superfluous, because there are already examples below the image.
I'm not a friend of duplicating the same information "everywhere". [regarding the "drawing with fltk"duplication]
Yeah, I'm not either, but I figure that's a rewrite of the
entire "drawing with fltk" section, a bigger issue.
I assume it's that way to make the intro into drawing easier
to understand, so the user doesn't have to jump around in the
docs. (One annoying thing about doxygen is if you click on a
link to another doc, then try to return to where you were with
the browser's Back button, you don't always end up where you
were..! I find I have to middle-click to open new tabs so I
don't loose my place)
To redo the doxygen docs, perhaps there's an \include
technique of some kind so the docs from elsewhere get pulled in to
that same location, avoiding duplicate docs.
To redo the doxygen docs, perhaps there's an \include technique of some kind so the docs from elsewhere get pulled in to that same location, avoiding duplicate docs.
documentation/src/index.dox:11: <B>FLTK \include{doc} version.dox Programming Manual</B>
documentation/src/index.dox:16: \include{doc} copyright.dox
documentation/src/preface.dox:6:\include{doc} version.dox,
documentation/src/preface.dox:83:FLTK is \include{doc} copyright.dox
The included files copyright.dox and
version.dox are tiny fragments
generated by CMake for exactly this usage.$ cat documentation/copyright.dox.in Copyright © 1998 - @YEAR@ by Bill Spitzak and others.This is to avoid having to edit certain files at every turn of the year.
On 8/29/26 09:32, 'Albrecht Schlosser' via fltk.coredev wrote:
On 8/29/26 18:06 Greg Ercolano wrote:
To redo the doxygen docs, perhaps there's an \include technique of some kind so the docs from elsewhere get pulled in to that same location, avoiding duplicate docs.
Yep, there is (for instance) `\include{doc}` which we already use, but IIRC that requires an entire file to be included.
[..]
If we wanted to include some documentation details in more than one place, then we'd have to add one file for each piece of docs (AFAICT). That doesn't make it easier to maintain.