diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-01 12:33:11 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-01 12:35:48 +0200 |
| commit | b65d3a249d4db1ada6d0bc96031e55459e0d6381 (patch) | |
| tree | cb2d4c2778263df4245b6cb7122ab0bd8826c5c4 /src/fl_oval_box.cxx | |
| parent | 95799bd3641ebe43400aa85dd8cf84405f26aac8 (diff) | |
Customize corner radius for rounded box/frame (#130)
Make maximum box corner radius and shadow width configurable.
See Fl::box_border_radius_max() and Fl::box_shadow_width().
Documentation: update image of box types.
Fixes #130
Diffstat (limited to 'src/fl_oval_box.cxx')
| -rw-r--r-- | src/fl_oval_box.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/fl_oval_box.cxx b/src/fl_oval_box.cxx index c094d7a68..9a0e1968a 100644 --- a/src/fl_oval_box.cxx +++ b/src/fl_oval_box.cxx @@ -1,7 +1,7 @@ // // Oval box drawing code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2011 by Bill Spitzak and others. +// Copyright 1998-2020 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -14,13 +14,17 @@ // https://www.fltk.org/bugs.php // - // Less-used box types are in separate files so they are not linked // in if not used. #include <FL/Fl.H> #include <FL/fl_draw.H> +// Global parameters for box drawing algorithm: +// +// BW = box shadow width +#define BW (Fl::box_shadow_width()) + static void fl_oval_flat_box(int x, int y, int w, int h, Fl_Color c) { Fl::set_box_color(c); fl_pie(x, y, w, h, 0, 360); @@ -37,7 +41,7 @@ static void fl_oval_box(int x, int y, int w, int h, Fl_Color c) { } static void fl_oval_shadow_box(int x, int y, int w, int h, Fl_Color c) { - fl_oval_flat_box(x+3,y+3,w,h,FL_DARK3); + fl_oval_flat_box(x+BW,y+BW,w,h,FL_DARK3); fl_oval_box(x,y,w,h,c); } |
