From c9553a50076674e368b23eefe56491aa7b87aae1 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 24 Oct 2008 21:27:47 +0000 Subject: [PATCH] Fixed a bug in the fill_gradient_rounded() function. It didn't always draw the entire rectangle. --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402594 --- dlib/gui_widgets/canvas_drawing.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlib/gui_widgets/canvas_drawing.h b/dlib/gui_widgets/canvas_drawing.h index 79db91917..e5608f384 100644 --- a/dlib/gui_widgets/canvas_drawing.h +++ b/dlib/gui_widgets/canvas_drawing.h @@ -530,11 +530,10 @@ namespace dlib unsigned long m_prev = 0, m = radius, c_div = valid_area.height() - 1; - long c_top = valid_area.top(); + const long c_top = valid_area.top(); + const long c_bottom = valid_area.bottom(); - long c_bottom = valid_area.bottom(); - - for ( int y = c_top; y <= c_bottom;y++ ) + for ( long y = c_top; y <= c_bottom;y++ ) { if ( y < valid_area.top() ) continue; @@ -583,8 +582,8 @@ namespace dlib m_prev = m; - draw_line ( c, point(valid_area.left() + m, y), - point(valid_area.right() - m, y), color ); + draw_line ( c, point(rect.left() + m, y), + point(rect.right() - m, y), color, valid_area ); } }