diff options
| author | Matthias Melcher <github@matthiasm.com> | 2025-11-01 14:33:06 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2025-11-01 14:33:06 +0100 |
| commit | ccbb424046c76e6b41c0a0f3c3804e53c359d169 (patch) | |
| tree | c299ab604a26ebdf7366a3af50b8367fe42ba7ad /FL | |
| parent | d14bd1bfecb705a8de17d251cb67588393ea412b (diff) | |
Add option to uniform line drawing in scaled mode (#167)
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/fl_draw.H | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 00e4f1e2d..7b9681cf1 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -229,6 +229,16 @@ inline void fl_point(int x, int y) { array results in a solid line. Odd array sizes are not supported and result in undefined behavior. + In scaled mode, horizontal and vertical lines are drawn with different line + widths, depending on the position of the line on screen, to adapt for gaps + when drawing adjacent lines. Setting \c FL_UNIFORM_WIDTH will make all lines + the same width, regardless of their position. This improves line drawings, + but may produce small gaps when drawing gradients or filling areas. + + \note When changing the line style inside a `draw()` method, make sure to + reset the line styles by calling \c fl_line_style(0) at the end of a + drawing routine or FLTK frame and box drawing will fail. + \note Because of how line styles are implemented on Win32 systems, you \e must set the line style \e after setting the drawing color. If you set the color after the line style you will lose @@ -260,7 +270,9 @@ enum { FL_JOIN_MITER = 0x1000, ///< join style: line join extends to a point FL_JOIN_ROUND = 0x2000, ///< join style: line join is rounded - FL_JOIN_BEVEL = 0x3000 ///< join style: line join is tidied + FL_JOIN_BEVEL = 0x3000, ///< join style: line join is tidied + + FL_UNIFORM_WIDTH = 0x10000 ///< use uniform line width, even in scaled contexts }; /** |
