[pitivi] keyframes: If the length of the line is inferior to one pixel,



commit 4936135910b3a5dd4e921aa130bec01db5109d37
Author: Mathieu Duponchelle <mduponchelle1 gmail com>
Date:   Tue Oct 1 18:37:53 2013 +0200

    keyframes: If the length of the line is inferior to one pixel,
    
    don't draw it.

 pitivi/timeline/elements.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 4fb183d..2b9164e 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -577,6 +577,10 @@ class TimelineElement(Clutter.Actor, Zoomable):
         adj = self.nsToPixel(keyframe.value.timestamp - lastKeyframe.value.timestamp)
         opp = (lastKeyframe.value.value - keyframe.value.value) * EXPANDED_SIZE
         hyp = math.sqrt(adj ** 2 + opp ** 2)
+
+        if (hyp < 1):  # line length would be less tan one pixel
+            return
+
         sinX = opp / hyp
         line.props.width = hyp
         line.props.height = KEYFRAME_SIZE


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