STR #2097 - attempt to workaround fl_round_box not honouring colors passwed to it from fl_rgb_color(...) calls.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6530 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Ian MacArthur 2008-11-27 20:43:27 +00:00
parent 865f3d8e61
commit 994c1d82a2

View File

@ -41,7 +41,7 @@ void fl_arc_i(int x,int y,int w,int h,double a1,double a2) {
enum {UPPER_LEFT, LOWER_RIGHT, CLOSED, FILL};
static void draw(int which, int x,int y,int w,int h, int inset, uchar color)
static void draw(int which, int x,int y,int w,int h, int inset, Fl_Color color)
{
if (inset*2 >= w) inset = (w-1)/2;
if (inset*2 >= h) inset = (h-1)/2;
@ -51,7 +51,7 @@ static void draw(int which, int x,int y,int w,int h, int inset, uchar color)
h -= 2*inset;
int d = w <= h ? w : h;
if (d <= 1) return;
fl_color((Fl_Color)color);
fl_color(color);
void (*f)(int,int,int,int,double,double);
f = (which==FILL) ? fl_pie : fl_arc_i;
if (which >= CLOSED) {
@ -85,29 +85,29 @@ extern uchar* fl_gray_ramp();
void fl_round_down_box(int x, int y, int w, int h, Fl_Color bgcolor) {
uchar *g = fl_gray_ramp();
draw(FILL, x, y, w, h, 2, bgcolor);
draw(UPPER_LEFT, x+1, y, w-2, h, 0, g['N']);
draw(UPPER_LEFT, x+1, y, w-2, h, 1, g['H']);
draw(UPPER_LEFT, x, y, w, h, 0, g['N']);
draw(UPPER_LEFT, x, y, w, h, 1, g['H']);
draw(LOWER_RIGHT, x, y, w, h, 0, g['S']);
draw(LOWER_RIGHT, x+1, y, w-2, h, 0, g['U']);
draw(LOWER_RIGHT, x, y, w, h, 1, g['U']);
draw(LOWER_RIGHT, x+1, y, w-2, h, 1, g['W']);
draw(CLOSED, x, y, w, h, 2, g['A']);
draw(UPPER_LEFT, x+1, y, w-2, h, 0, (Fl_Color)g['N']);
draw(UPPER_LEFT, x+1, y, w-2, h, 1, (Fl_Color)g['H']);
draw(UPPER_LEFT, x, y, w, h, 0, (Fl_Color)g['N']);
draw(UPPER_LEFT, x, y, w, h, 1, (Fl_Color)g['H']);
draw(LOWER_RIGHT, x, y, w, h, 0, (Fl_Color)g['S']);
draw(LOWER_RIGHT, x+1, y, w-2, h, 0, (Fl_Color)g['U']);
draw(LOWER_RIGHT, x, y, w, h, 1, (Fl_Color)g['U']);
draw(LOWER_RIGHT, x+1, y, w-2, h, 1, (Fl_Color)g['W']);
draw(CLOSED, x, y, w, h, 2, (Fl_Color)g['A']);
}
void fl_round_up_box(int x, int y, int w, int h, Fl_Color bgcolor) {
uchar *g = fl_gray_ramp();
draw(FILL, x, y, w, h, 2, bgcolor);
draw(LOWER_RIGHT, x+1, y, w-2, h, 0, g['H']);
draw(LOWER_RIGHT, x+1, y, w-2, h, 1, g['N']);
draw(LOWER_RIGHT, x, y, w, h, 1, g['H']);
draw(LOWER_RIGHT, x, y, w, h, 2, g['N']);
draw(UPPER_LEFT, x, y, w, h, 2, g['U']);
draw(UPPER_LEFT, x+1, y, w-2, h, 1, g['S']);
draw(UPPER_LEFT, x, y, w, h, 1, g['W']);
draw(UPPER_LEFT, x+1, y, w-2, h, 0, g['U']);
draw(CLOSED, x, y, w, h, 0, g['A']);
draw(LOWER_RIGHT, x+1, y, w-2, h, 0, (Fl_Color)g['H']);
draw(LOWER_RIGHT, x+1, y, w-2, h, 1, (Fl_Color)g['N']);
draw(LOWER_RIGHT, x, y, w, h, 1, (Fl_Color)g['H']);
draw(LOWER_RIGHT, x, y, w, h, 2, (Fl_Color)g['N']);
draw(UPPER_LEFT, x, y, w, h, 2, (Fl_Color)g['U']);
draw(UPPER_LEFT, x+1, y, w-2, h, 1, (Fl_Color)g['S']);
draw(UPPER_LEFT, x, y, w, h, 1, (Fl_Color)g['W']);
draw(UPPER_LEFT, x+1, y, w-2, h, 0, (Fl_Color)g['U']);
draw(CLOSED, x, y, w, h, 0, (Fl_Color)g['A']);
}
extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*);