[pitivi] ruler: Simplify drawTimes a bit
- From: Mathieu Duponchelle <mathieudu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] ruler: Simplify drawTimes a bit
- Date: Tue, 4 Feb 2014 21:50:37 +0000 (UTC)
commit d5e32d0f1d2619ea543187fe613964a0f7adddc3
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Dec 31 15:24:23 2013 +0100
ruler: Simplify drawTimes a bit
pitivi/timeline/ruler.py | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/pitivi/timeline/ruler.py b/pitivi/timeline/ruler.py
index 9c1dccc..da8b2bc 100644
--- a/pitivi/timeline/ruler.py
+++ b/pitivi/timeline/ruler.py
@@ -289,15 +289,12 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
seconds = seconds - (seconds % interval) + interval
paintpos += spacing - offset
+ state = Gtk.StateFlags.NORMAL
+ style = self.get_style_context()
+ setCairoColor(context, style.get_color(state))
+ y_bearing = context.text_extents("0")[1]
while paintpos < context.get_target().get_width():
- if paintpos < self.nsToPixel(Gst.CLOCK_TIME_NONE):
- state = Gtk.StateFlags.ACTIVE
- else:
- state = Gtk.StateFlags.NORMAL
timevalue = time_to_string(long(seconds))
- style = self.get_style_context()
- setCairoColor(context, style.get_color(state))
- x_bearing, y_bearing = context.text_extents("0")[:2]
context.move_to(int(paintpos), 1 - y_bearing)
context.show_text(timevalue)
paintpos += spacing
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]