# -*- coding: utf-8; -*-
-# gzv.py - an user interface to generate-zooming-video
+# gzv.py - an user interface to select people in a picture
#
# Copyright (C) 2008 Lincoln de Sousa <lincoln@minaslivre.org>
#
# point begining from the left image border
wib = self.point_with_border(ball)
- print wib.x, w
-
- self.wid('viewport').get_vadjustment().value = wib.x # + (w / 2)
- self.wid('viewport').get_hadjustment().value = wib.y # + (h / 2)
+ #self.wid('viewport').get_vadjustment().value = wib.x # + (w / 2)
+ #self.wid('viewport').get_hadjustment().value = wib.y # + (h / 2)
self.draw.queue_draw()
self.balls.save_to_file(self.project.focus_points_file)
+ def move_fp_up(self, *args):
+ selection = self.treeview.get_selection()
+ model, path = selection.get_selected()
+ if not path:
+ return
+
+ pos = model[path][0]
+ newpos = max(pos - 1, 0)
+ self.balls.insert(newpos, self.balls.pop(pos))
+
+ # normalizing the position of elements.
+ for index, item in enumerate(self.balls):
+ item.position = index
+
+ self.load_balls_to_treeview()
+ selection.select_path(str(newpos))
+
+ def move_fp_down(self, *args):
+ selection = self.treeview.get_selection()
+ model, path = selection.get_selected()
+ if not path:
+ return
+
+ pos = model[path][0]
+ newpos = min(pos + 1, len(self.balls))
+ self.balls.insert(newpos, self.balls.pop(pos))
+
+ # normalizing the position of elements.
+ for index, item in enumerate(self.balls):
+ item.position = index
+
+ self.load_balls_to_treeview()
+ selection.select_path(str(newpos))
+
def expose_draw(self, draw, event):
if not self.image:
return