FLTK logo

[fltk.coredev] fl_arc() doc improvement?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
[  All Forums  |  Back to fltk.coredev  ]
 
[ Previous Message ] [ New Message | Reply ] [ Next Message ]

fl_arc() doc improvement? Greg Ercolano 18:57 Aug 28  
 

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.

So I'm asking if I missed anything or if there's better wording needed.

Oh, and the above as a diff:

--- 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);

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.



--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fltkcoredev/58c5d262-f74a-4378-8466-96c815ea715c%40seriss.com.
[ Direct Link to Message ]
 
     
[ Previous Message ] [ New Message | Reply ] [ Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.