[gtk+/wip/blur] Take the bigger box to create the box-shadow surface
- From: Andrea Cimitan <acimitan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/blur] Take the bigger box to create the box-shadow surface
- Date: Mon, 16 Apr 2012 14:13:37 +0000 (UTC)
commit 402262922a667dac6d60a25bdf15130a8a1d64db
Author: Andrea Cimitan <andrea cimitan canonical com>
Date: Mon Apr 16 15:13:16 2012 +0100
Take the bigger box to create the box-shadow surface
gtk/gtkshadow.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkshadow.c b/gtk/gtkshadow.c
index 6b602c1..eeab349 100644
--- a/gtk/gtkshadow.c
+++ b/gtk/gtkshadow.c
@@ -498,16 +498,20 @@ _gtk_box_shadow_render (GtkShadow *shadow,
cairo_t *cr_surface;
cairo_surface_t *surface;
gint bradius;
- gdouble x, y;
+ gdouble x, y, width, height;
bradius = element->radius;
cairo_get_current_point (cr, &x, &y);
+ /* Take the bigger box to create the surface. */
+ width = MAX (padding_box->box.width, box.box.width);
+ height = MAX (padding_box->box.height, box.box.height);
+
/* Create a larger surface to center the blur. */
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- padding_box->box.width + bradius * 2,
- padding_box->box.height + bradius * 2);
+ width + bradius * 2,
+ height + bradius * 2);
cr_surface = cairo_create (surface);
/* Center the rendering. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]