changeset 760:634e8a3ebd0a

when you drag a sub into CC and it makes a new fade, leave both points in the fade selected Ignore-this: e001a167b42b7c5471a0b2f240b2d12d
author drewp@bigasterisk.com
date Sat, 16 Jun 2012 01:33:36 +0000
parents f22f925442a2
children 857aab04f7bd
files bin/curvecalc light9/curvecalc/curveview.py
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/bin/curvecalc	Sat Jun 16 01:31:50 2012 +0000
+++ b/bin/curvecalc	Sat Jun 16 01:33:36 2012 +0000
@@ -99,8 +99,8 @@
         curveView = self.curvesetView.row(subName).curveView
         t = self.lastSeenInputTime # curveView.current_time() # new curve hasn't heard the time yet. this has gotten too messy- everyone just needs to be able to reach the time source
         print "time", t
-        curveView.add_point((t - .5, 0))
-        curveView.add_point((t, 1))
+        curveView.add_points([(t - .5, 0),
+                              (t, 1)])
             
 
     def onNewCurve(self, *args):
--- a/light9/curvecalc/curveview.py	Sat Jun 16 01:31:50 2012 +0000
+++ b/light9/curvecalc/curveview.py	Sat Jun 16 01:33:36 2012 +0000
@@ -837,10 +837,13 @@
         y = self.curve.eval(x)
         self.add_point((x, y))
 
+    def add_points(self, pts):
+        idxs = [self.curve.insert_pt(p) for p in pts]
+        self.update_curve()
+        self.select_indices(idxs)
+        
     def add_point(self, p):
-        i = self.curve.insert_pt(p)
-        self.update_curve()
-        self.select_indices([i])
+        self.add_points([p])
 
     def add_marker(self, p):
         self.markers.insert_pt(p)