def _press_event(self, event): vx, vy = BoxEditor.get_box_val_point(self, event.x, event.y) p = lutfilter.CurvePoint(int(round(vx * 255)), int(round(vy * 255))) self.last_point = p self.edit_on = True self.curve.remove_range(self.last_point.x - 3, self.last_point.x + 3 ) self.curve.set_curve_point(p) self.widget.queue_draw()
def _motion_notify_event(self, x, y, state): if self.edit_on == False: return vx, vy = BoxEditor.get_box_val_point(self, x, y) p = lutfilter.CurvePoint(int(round(vx * 255)), int(round(vy * 255))) self.curve.remove_range(self.last_point.x, p.x) self.curve.set_curve_point(p) self.last_point = p self.widget.queue_draw()
def _release_event(self, event): if self.edit_on == False: return vx, vy = BoxEditor.get_box_val_point(self, event.x, event.y) p = lutfilter.CurvePoint(int(round(vx * 255)),int(round(vy * 255))) self.curve.remove_range(self.last_point.x, p.x) self.curve.set_curve_point(p) self.edit_on = False self.edit_listener.curve_edit_done() self.widget.queue_draw()