[pitivi] previewer.py: scale audio thumbnails to the current zoom



commit 28261a685e568e56106949f57e2a4c266ad72a7c
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date:   Wed Jul 29 16:28:40 2009 -0700

    previewer.py: scale audio thumbnails to the current zoom

 pitivi/ui/previewer.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/previewer.py b/pitivi/ui/previewer.py
index a5d6748..e4160a2 100644
--- a/pitivi/ui/previewer.py
+++ b/pitivi/ui/previewer.py
@@ -492,6 +492,14 @@ class RandomAccessAudioPreviewer(RandomAccessPreviewer):
 
         cr.stroke()
 
+    def _thumbForTime(self, cr, time, x, y):
+        RandomAccessPreviewer._thumbForTime(self, cr, time, x, y)
+        x_scale = float(self.base_width) / self.twidth
+        matrix = cairo.Matrix()
+        matrix.scale(x_scale, 1.0)
+        matrix.translate(-x, -y)
+        cr.get_source().set_matrix(matrix)
+
     def _connectSettings(self, settings):
         RandomAccessPreviewer._connectSettings(self, settings)
         self._view = settings.showWaveforms



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