[libhandy] shadow-helper: Skip any drawing at 0 or 1 progress



commit 225347c5b677fb48313a20a15e2c01d12a76da7f
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Jun 25 17:25:02 2020 +0500

    shadow-helper: Skip any drawing at 0 or 1 progress
    
    These values correspond to the initial and final states. There's no need
    to draw anything in those cases, and it will help to avoid an unwanted
    outline later.

 src/hdy-shadow-helper.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/hdy-shadow-helper.c b/src/hdy-shadow-helper.c
index 7b2962c5..c6b20f55 100644
--- a/src/hdy-shadow-helper.c
+++ b/src/hdy-shadow-helper.c
@@ -326,6 +326,9 @@ hdy_shadow_helper_draw_shadow (HdyShadowHelper *self,
   gdouble remaining_distance, shadow_opacity;
   gint shadow_size, border_size, distance;
 
+  if (progress <= 0 || progress >= 1)
+    return;
+
   cache_shadow (self, width, height, direction);
 
   shadow_size = self->shadow_size;


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