Skip to content

Commit

Permalink
Use fl_xyline() and fl_yxline() that are better for horizontal and ve…
Browse files Browse the repository at this point in the history
…rtical lines.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10460 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Nov 18, 2014
1 parent b8a1618 commit a5c4784
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/fl_gleam.cxx
Expand Up @@ -45,15 +45,15 @@ static void shade_rect_top_bottom(int x, int y, int w, int h, Fl_Color fg1, Fl_C
// This loop generates the gradient at the top of the widget
for (float k = 1; k >= 0; k -= step_size_top){
gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
fl_line(x, y+j, x+w, y+j);
fl_xyline(x, y+j, x+w);
j++;
}
gleam_color(fg1);
fl_rectf(x, y+h_top, w+1, h_flat);
// This loop generates the gradient at the bottom of the widget
for (float k = 1; k >= 0; k -= step_size_bottom){
gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
fl_xyline(x, y+j+h_flat-1, x+w);
j++;
}
}
Expand All @@ -68,16 +68,16 @@ static void shade_rect_top_bottom_down(int x, int y, int w, int h, Fl_Color bc,

static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, Fl_Color lc) {
gleam_color(fg1);
fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
fl_line(x+1, y, x+w-1, y); //Go across the top
fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
fl_yxline(x, y+h-1, y+1); //Go from bottom to top left side
fl_yxline(x+w, y+h-1, y+1); //Go from bottom to top right side
fl_xyline(x+1, y, x+w-1); //Go across the top
fl_xyline(x+1, y+h, x+w-1); //Go across the bottom
gleam_color(fg2);
fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
fl_yxline(x+1, y+h-2, y+2); //Go from bottom to top left side
fl_yxline(x+w-1, y+h-2, y+2); //Go from bottom to top right side
gleam_color(lc);
fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
fl_line(x+2, y+h-1, x+w-3, y+h-1); //Go across the bottom
fl_xyline(x+2, y+1, x+w-3); //Go across the top
fl_xyline(x+2, y+h-1, x+w-3); //Go across the bottom
}

static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, Fl_Color lc, float th1, float th2) {
Expand Down

0 comments on commit a5c4784

Please sign in to comment.