From afbd833c04cbde1dbb04f390d394635fad8ae5e2 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 8 Aug 2005 01:35:29 +0000 Subject: [PATCH] Fixed some plastic drawing artifacts (STR #906) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 1 + src/fl_plastic.cxx | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 0d778bb03..32cb701e0 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ CHANGES IN FLTK 1.1.7 - Documentation fixes (STR #648, STR #692, STR #730, STR #744, STR #745, STR #942, STR #931) + - Fixed some plastic drawing artifacts (STR #906) - Fl_Help_View now draws the box outside the scrollbars, like the other scrollable widgets (STR #871) - The fltk-config script now handles invocation via a diff --git a/src/fl_plastic.cxx b/src/fl_plastic.cxx index 6a88e2788..b07ab65b0 100644 --- a/src/fl_plastic.cxx +++ b/src/fl_plastic.cxx @@ -167,7 +167,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { for (i = 0, j = 0; j < chalf; i ++, j += cstep) { // Draw the top line and points... fl_color(shade_color(g[c[i]], bc)); - fl_xyline(x + 1, y + i, x + w - 1); + fl_xyline(x + 1, y + i, x + w - 2); fl_color(shade_color(g[c[i] - 2], bc)); fl_point(x, y + i + 1); @@ -175,7 +175,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { // Draw the bottom line and points... fl_color(shade_color(g[c[clen - i]], bc)); - fl_xyline(x + 1, y + h - i, x + w - 1); + fl_xyline(x + 1, y + h - i, x + w - 2); fl_color(shade_color(g[c[clen - i] - 2], bc)); fl_point(x, y + h - i); @@ -202,26 +202,26 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { fl_color(shade_color(g[c[i] - 2], bc)); fl_point(x + i + 1, y); - fl_point(x + i + 1, y + h - 1); + fl_point(x + i + 1, y + h); // Draw the right line and points... fl_color(shade_color(g[c[clen - i]], bc)); fl_yxline(x + w - 1 - i, y + 1, y + h - 1); fl_color(shade_color(g[c[clen - i] - 2], bc)); - fl_point(x + w - 1 - i, y); - fl_point(x + w - 1 - i, y + h - 1); + fl_point(x + w - 2 - i, y); + fl_point(x + w - 2 - i, y + h); } // Draw the interior, top, and bottom... i = chalf / cstep; fl_color(shade_color(g[c[chalf]], bc)); - fl_rectf(x + i, y + 1, w - 2 * i, h - 2); + fl_rectf(x + i, y + 1, w - 2 * i, h - 1); fl_color(shade_color(g[c[chalf] - 2], bc)); fl_xyline(x + i, y, x + w - i); - fl_xyline(x + i, y + h - 1, x + w - i); + fl_xyline(x + i, y + h, x + w - i); } }