[libchamplain: 25/45] Fix clutter_canvas_set_size errors in console.



commit a8bfb041529d081a8b1b1dc99d37f0fb600c03b7
Author: Marius Stanciu <stanciumarius94 gmail com>
Date:   Sun Jul 17 16:52:41 2016 +0300

    Fix clutter_canvas_set_size errors in console.

 champlain/champlain-path-layer.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlain-path-layer.c b/champlain/champlain-path-layer.c
index 89a0db9..52aced0 100644
--- a/champlain/champlain-path-layer.c
+++ b/champlain/champlain-path-layer.c
@@ -537,6 +537,12 @@ invalidate_canvas (ChamplainPathLayer *layer)
       right_actor_height = MIN (map_height - (viewport_y + anchor_y), (gint)view_height);
       left_actor_width = MIN (view_width - right_actor_width, map_width - right_actor_width);
       left_actor_height = right_actor_height;
+
+      /* Ensure sizes are positive  */
+      right_actor_width = MAX (0, right_actor_width);
+      right_actor_height = MAX (0, right_actor_height);
+      left_actor_width = MAX (0, left_actor_width);
+      left_actor_height = MAX (0, left_actor_height);
     }
 
   clutter_actor_set_size (priv->path_actor, map_width, map_height);


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