[gtk] gsk: Increase blur node bounds by blur radius



commit cac3e7705dc683618b56f28705050eb49d2ffbaf
Author: Timm Bäder <mail baedert org>
Date:   Tue Feb 27 14:12:25 2018 +0100

    gsk: Increase blur node bounds by blur radius
    
    Otherwise, the resulting node will be too small and the result looks
    clipped.

 gsk/gskrendernodeimpl.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 91678994f1..77c53e264f 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -4336,6 +4336,7 @@ gsk_blur_node_new (GskRenderNode *child,
                    double         radius)
 {
   GskBlurNode *self;
+  float clip_radius = gsk_cairo_blur_compute_pixels (radius);
 
   g_return_val_if_fail (GSK_IS_RENDER_NODE (child), NULL);
 
@@ -4345,6 +4346,8 @@ gsk_blur_node_new (GskRenderNode *child,
   self->radius = radius;
 
   graphene_rect_init_from_rect (&self->render_node.bounds, &child->bounds);
+  graphene_rect_inset (&self->render_node.bounds,
+                       - clip_radius, - clip_radius);
 
   return &self->render_node;
 }


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