[pitivi] timeline: make sure not to set a negative size on elements.



commit 860d904e353ab2ea4b3bf5a0a465f508da145034
Author: Mathieu Duponchelle <mathieu duponchelle opencreed com>
Date:   Sun May 11 23:40:49 2014 +0200

    timeline: make sure not to set a negative size on elements.

 pitivi/timeline/elements.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index d5b72e1..04b98c3 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -315,13 +315,13 @@ class TimelineElement(Clutter.Actor, Zoomable):
                 self.rightHandle.set_easing_duration(600)
 
         self.marquee.set_size(width, height)
-        self.background.props.width = width - 2
-        self.background.props.height = height - 2
+        self.background.props.width = max(width - 2, 1)
+        self.background.props.height = max(height - 2, 1)
         self.border.props.width = width
         self.border.props.height = height
         self.props.width = width
         self.props.height = height
-        self.preview.set_size(width - 2, height - 2)
+        self.preview.set_size(max(width - 2, 1), max(height - 2, 1))
         if self.rightHandle:
             self.rightHandle.set_position(width - self.rightHandle.props.width, 0)
 


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