[pitivi] curve.py, timelinecanvas.py: rename KW_LABEL_OVERFLOW to KW_LABEL_Y_OVERFLOW
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] curve.py, timelinecanvas.py: rename KW_LABEL_OVERFLOW to KW_LABEL_Y_OVERFLOW
- Date: Mon, 8 Feb 2010 16:48:13 +0000 (UTC)
commit 53a4b493c7f19e7812f9996b3405d9c30dc26841
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Wed Jan 27 12:42:25 2010 -0800
curve.py,timelinecanvas.py: rename KW_LABEL_OVERFLOW to KW_LABEL_Y_OVERFLOW
pitivi/ui/curve.py | 15 +++++++++------
pitivi/ui/timelinecanvas.py | 5 +++--
2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/ui/curve.py b/pitivi/ui/curve.py
index 8f41595..c4db4e0 100644
--- a/pitivi/ui/curve.py
+++ b/pitivi/ui/curve.py
@@ -47,7 +47,8 @@ KW_MOUSE_WIDTH = KW_WIDTH2 + 1
KW_MOUSE_HEIGHT = KW_HEIGHT2 + 1
KW_LABEL_X_OFFSET = KW_WIDTH2 + 5
KW_LABEL_Y_OFFSET = -10
-KW_LABEL_OVERFLOW = 10
+KW_LABEL_X_OVERFLOW = 50
+KW_LABEL_Y_OVERFLOW = 12
KW_LABEL_HPAD = 4
KW_LABEL_VPAD = 4
KW_LABEL_HPAD2 = KW_LABEL_VPAD / 2
@@ -117,7 +118,7 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
bounds = view.bounds
time = (Zoomable.pixelToNs(pos[0] - bounds.x1) +
view.element.in_point)
- value = ((1 - (pos[1] - KW_LABEL_OVERFLOW - bounds.y1 -
+ value = ((1 - (pos[1] - KW_LABEL_Y_OVERFLOW - bounds.y1 -
view._min) / view._range) *
interpolator.range) + interpolator.lower
return time, value
@@ -144,7 +145,7 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
self.interpolator = interpolator
self._focused_kf = None
self.normal()
- self.set_simple_transform(0, -KW_LABEL_OVERFLOW, 1.0, 0)
+ self.set_simple_transform(0, -KW_LABEL_Y_OVERFLOW, 1.0, 0)
## properties
@@ -194,14 +195,15 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
def do_simple_update(self, cr):
cr.identity_matrix()
if self.element.factory:
+ self.visible_width = self.nsToPixel(self.element.duration)
self.bounds = goocanvas.Bounds(0, 0,
- Zoomable.nsToPixel(self.element.duration), self.height +
- KW_LABEL_OVERFLOW)
+ self.visible_width + KW_LABEL_X_OVERFLOW,
+ self.height + KW_LABEL_Y_OVERFLOW)
def _getKeyframeXY(self, kf):
interp = self.interpolator
x = self.nsToPixel(kf.time - self.element.in_point)
- y = KW_LABEL_OVERFLOW + self._range - (((kf.value -
+ y = KW_LABEL_Y_OVERFLOW + self._range - (((kf.value -
interp.lower) / interp.range) * self._range)
return point.Point(x + self.bounds.x1, y + self.bounds.y1 + self._min)
@@ -229,6 +231,7 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
cr.fill_preserve()
cr.set_source_rgb(1, 0, 0)
cr.stroke()
+
# re-draw the focused keyframe, if it exists, inverted
if self._focused_kf:
self._controlPoint(cr, self._focused_kf)
diff --git a/pitivi/ui/timelinecanvas.py b/pitivi/ui/timelinecanvas.py
index 1051fd6..e0a823c 100644
--- a/pitivi/ui/timelinecanvas.py
+++ b/pitivi/ui/timelinecanvas.py
@@ -34,6 +34,7 @@ from pitivi.ui.prefs import PreferencesDialog
from pitivi.ui.common import TRACK_SPACING, unpack_cairo_pattern, \
LAYER_HEIGHT_EXPANDED, LAYER_SPACING
from pitivi.ui.controller import Controller
+from pitivi.ui.curve import KW_LABEL_Y_OVERFLOW
# cursors to be used for resizing objects
ARROW = gtk.gdk.Cursor(gtk.gdk.ARROW)
@@ -99,7 +100,7 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable):
self._cursor = ARROW
root = self.get_root_item()
self.tracks = goocanvas.Group()
- self.tracks.set_simple_transform(0, 10, 1.0, 0)
+ self.tracks.set_simple_transform(0, KW_LABEL_Y_OVERFLOW, 1.0, 0)
root.add_child(self.tracks)
self._marquee = goocanvas.Rect(
parent=root,
@@ -178,7 +179,7 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable):
event.area.x, event.area.y,
event.area.width, event.area.height)
- y = 10
+ y = KW_LABEL_Y_OVERFLOW
for track in self._tracks[:-1]:
y += track.height
self.style.paint_box(event.window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]