Changeset - 634e8a3ebd0a
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 13 years ago 2012-06-16 01:33:36
drewp@bigasterisk.com
when you drag a sub into CC and it makes a new fade, leave both points in the fade selected
Ignore-this: e001a167b42b7c5471a0b2f240b2d12d
2 files changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -90,26 +90,26 @@ class Main(object):
 
    def onDataReceived(self, widget, context, x, y, selection,
 
                       targetType, time):
 
        uri = URIRef(selection.data.strip())
 
        subName = self.graph.label(uri)
 

	
 
        try:
 
            self.makeSubterm(subName, withCurve=True)
 
        except SubtermExists:
 
            pass
 
        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):
 
        dialog = self.wtree.get_object("newCurve")
 
        entry = self.wtree.get_object("newCurveName")
 
        # if you don't have songx, that should be the suggested name
 
        entry.set_text("")
 
        if dialog.run() == 1:
 
            self.curveset.new_curve(entry.get_text())
 
        dialog.hide()
 

	
 
    def onNewSubterm(self, *args):
light9/curvecalc/curveview.py
Show inline comments
 
@@ -828,28 +828,31 @@ class Curveview(object):
 
        try:
 
            handletags = [t for t in tags if t.startswith('handle')]
 
            return int(handletags[0][6:])
 
        except IndexError:
 
            raise ValueError("no point found")
 
        
 
    def new_point_at_mouse(self, ev):
 
        p = self.world_from_screen(ev.x,ev.y)
 
        x = p[0]
 
        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)
 
        self.update_curve()
 
        
 
    def remove_point_idx(self, *idxs):
 
        idxs = list(idxs)
 
        while idxs:
 
            i = idxs.pop()
 

	
 
            self.curve.points.pop(i)
 
            newsel = []
0 comments (0 inline, 0 general)