summaryrefslogtreecommitdiff
path: root/src/fl_rounded_box.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-09-01 12:33:11 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-09-01 12:35:48 +0200
commitb65d3a249d4db1ada6d0bc96031e55459e0d6381 (patch)
treecb2d4c2778263df4245b6cb7122ab0bd8826c5c4 /src/fl_rounded_box.cxx
parent95799bd3641ebe43400aa85dd8cf84405f26aac8 (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_rounded_box.cxx')
-rw-r--r--src/fl_rounded_box.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fl_rounded_box.cxx b/src/fl_rounded_box.cxx
index 4c1eb6aae..df41b4f6e 100644
--- a/src/fl_rounded_box.cxx
+++ b/src/fl_rounded_box.cxx
@@ -1,7 +1,7 @@
//
// Rounded box drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2016 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
@@ -17,15 +17,15 @@
#include <FL/Fl.H>
#include <FL/fl_draw.H>
-// Constants for rounded corner drawing algorithm:
+// Global parameters for rounded corner drawing algorithm:
//
// RN = number of segments per corner (must match offset array size)
// RS = max. corner radius
// BW = box shadow width
-#define RN 5
-#define RS 15
-#define BW 3
+#define RN 5
+#define RS (Fl::box_border_radius_max())
+#define BW (Fl::box_shadow_width())
static double offset[RN] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0};