[murrine] Fixed mislignment to the spinbutton's separator.



commit bf86a2550456032de4516b938c6043de5ae96bfc
Author: Andrea Cimitan <andrea cimitan gmail com>
Date:   Wed Dec 9 10:11:24 2009 +0100

    Fixed mislignment to the spinbutton's separator.

 src/murrine_draw.c      |   20 +++++++++++++++-----
 src/murrine_draw_rgba.c |   12 ++++++++----
 2 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/src/murrine_draw.c b/src/murrine_draw.c
index 6680b4d..b117fa6 100644
--- a/src/murrine_draw.c
+++ b/src/murrine_draw.c
@@ -154,7 +154,13 @@ murrine_draw_button (cairo_t *cr,
 	MurrineGradients mrn_gradient_new = widget->mrn_gradient;
 	MurrineRGB border = colors->shade[!widget->disabled ? 6 : 5];
 	MurrineRGB fill = colors->bg[widget->state_type];
-
+/*
+	if (widget->active)
+	{
+		mrn_gradient_new.has_border_colors = FALSE;
+		mrn_gradient_new.has_gradient_colors = FALSE;
+	}
+*/
 	murrine_get_fill_color (&fill, &mrn_gradient_new);
 
 	if (widget->disabled)
@@ -433,13 +439,17 @@ murrine_draw_spinbutton (cairo_t *cr,
 				murrine_shade (&mrn_gradient_new.gradient_colors[2], mrn_gradient_new.gradient_shades[2], &highlight);
 			murrine_shade (&highlight, lightborder_shade_new*mrn_gradient_new.gradient_shades[2], &highlight);
 
-			cairo_move_to (cr, x+3, y+height/2.0);
-			cairo_line_to (cr, width-2,  y+height/2.0);
+			/* this will align the path to the cairo grid */
+			if (height % 2 != 0)
+				height++;
+
+			cairo_move_to (cr, x+3, y+height/2.0-0.5);
+			cairo_line_to (cr, width-2,  y+height/2.0-0.5);
 			murrine_set_color_rgb (cr, &line);
 			cairo_stroke (cr);
 
-			cairo_move_to (cr, x+4, y+height/2.0+1);
-			cairo_line_to (cr, width-3,  y+height/2.0+1);
+			cairo_move_to (cr, x+4, y+height/2.0+0.5);
+			cairo_line_to (cr, width-3,  y+height/2.0+0.5);
 			murrine_set_color_rgba (cr, &highlight, 0.5);
 			cairo_stroke (cr);
 			break;
diff --git a/src/murrine_draw_rgba.c b/src/murrine_draw_rgba.c
index faf3da5..421b9fa 100644
--- a/src/murrine_draw_rgba.c
+++ b/src/murrine_draw_rgba.c
@@ -477,13 +477,17 @@ murrine_rgba_draw_spinbutton (cairo_t *cr,
 				murrine_shade (&mrn_gradient_new.gradient_colors[2], mrn_gradient_new.gradient_shades[2], &highlight);
 			murrine_shade (&highlight, lightborder_shade_new*mrn_gradient_new.gradient_shades[2], &highlight);
 		
-			cairo_move_to (cr, x+3, y+height/2.0);
-			cairo_line_to (cr, width-2,  y+height/2.0);
+			/* this will align the path to the cairo grid */
+			if (height % 2 != 0)
+				height++;
+
+			cairo_move_to (cr, x+3, y+height/2.0-0.5);
+			cairo_line_to (cr, width-2,  y+height/2.0-0.5);
 			murrine_set_color_rgb (cr, &line);
 			cairo_stroke (cr);
 
-			cairo_move_to (cr, x+4, y+height/2.0+1);
-			cairo_line_to (cr, width-3,  y+height/2.0+1);
+			cairo_move_to (cr, x+4, y+height/2.0+0.5);
+			cairo_line_to (cr, width-3,  y+height/2.0+0.5);
 			murrine_set_color_rgba (cr, &highlight, 0.5);
 			cairo_stroke (cr);
 			break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]