[glade/offscreen-design-layout] * gladeui/glade-design-layout.c: o replaced cairo_clip()/cairo_paint_with_alpha() with cairo_fill(
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/offscreen-design-layout] * gladeui/glade-design-layout.c: o replaced cairo_clip()/cairo_paint_with_alpha() with cairo_fill(
- Date: Tue, 25 Jan 2011 02:59:27 +0000 (UTC)
commit a39e9c43f174b6724a1c9ba43c4a3a1186ea5c9f
Author: Juan Pablo Ugarte <jp synctv com>
Date: Mon Jan 24 23:57:06 2011 -0300
* gladeui/glade-design-layout.c:
o replaced cairo_clip()/cairo_paint_with_alpha() with cairo_fill()
o added alpha to the gradient using color_stop_rgba() to make it more noticeable
gladeui/glade-design-layout.c | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/gladeui/glade-design-layout.c b/gladeui/glade-design-layout.c
index 715014f..71535e7 100644
--- a/gladeui/glade-design-layout.c
+++ b/gladeui/glade-design-layout.c
@@ -492,27 +492,22 @@ draw_selection (cairo_t *cr, GtkWidget *parent, GtkWidget *widget,
{
cairo_pattern_t *gradient;
GtkAllocation alloc;
+ gdouble cx, cy;
gint x, y;
gtk_widget_get_allocation (widget, &alloc);
- gtk_widget_translate_coordinates (widget, parent, 0, 0, &x, &y);
-
- x += offset;
- y += offset;
+ gtk_widget_translate_coordinates (widget, parent, offset, offset, &x, &y);
+
+ cx = x + alloc.width/2;
+ cy = y + alloc.height/2;
+ gradient = cairo_pattern_create_radial (cx, cy, MIN (alloc.width, alloc.height)/6,
+ cx, cy, MAX (alloc.width, alloc.height)/2);
+ cairo_pattern_add_color_stop_rgba (gradient, 0, r+.24, g+.24, b+.24, .16);
+ cairo_pattern_add_color_stop_rgba (gradient, 1, r, g, b, .28);
+ cairo_set_source (cr, gradient);
cairo_rectangle (cr, x, y, alloc.width, alloc.height);
-#ifdef USE_LINEAR_GRADIENT
- gradient = cairo_pattern_create_linear (x, y, x+alloc.width, y+alloc.height);
-#else
- gradient = cairo_pattern_create_radial (x+alloc.width/2, y+alloc.height/2, MIN (alloc.width, alloc.height)/6,
- x+alloc.width/2, y+alloc.height/2, MAX (alloc.width, alloc.height)/2);
-#endif
- cairo_pattern_add_color_stop_rgb (gradient, 0, r+.16, g+.16, b+.16);
- cairo_pattern_add_color_stop_rgb (gradient, 1, r, g, b);
- cairo_set_source (cr, gradient);
- cairo_clip (cr);
- cairo_paint_with_alpha (cr, .32);
- cairo_reset_clip (cr);
+ cairo_fill (cr);
cairo_rectangle (cr, x, y, alloc.width, alloc.height);
cairo_set_source_rgba (cr, r, g, b, .75);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]