From 23db57ad3b8610d49aa321f801270e4486f95282 Mon Sep 17 00:00:00 2001 From: Alexandre Antonino Gonçalves Martinazzo Date: Tue, 21 Aug 2007 16:30:36 +0000 Subject: Modifications on selection and gelection bounds (by pekayatt) --- diff --git a/Area.py b/Area.py index 0451c32..8d62654 100644 --- a/Area.py +++ b/Area.py @@ -135,6 +135,7 @@ class Area(gtk.DrawingArea): self.rainbow_counter = 0 self.font = pango.FontDescription('Sans 9') + self._set_selection_bounds(0,0,0,0) #start of UNDO and REDO self.first_undo = True @@ -269,9 +270,13 @@ class Area(gtk.DrawingArea): self.last = -1, -1 self.d.rainbow(widget, coords, self.last, self.rainbow_counter,self.line_size, self.brush_shape) self.last = coords + x , y, state = event.window.get_pointer() - if state & gtk.gdk.BUTTON3_MASK: + x0, y0, x1, y1 = self.get_selection_bounds() + + if (state & gtk.gdk.BUTTON3_MASK) or not (x0 self.d.oldx: x0 = self.d.oldx @@ -594,9 +595,9 @@ class Desenho: x0 = self.d.sx if self.d.sy > self.d.oldy: - x1 = self.d.oldy + y0 = self.d.oldy else: - x1 = self.d.sy + y0 = self.d.sy w = self.d.sx - self.d.oldx if w < 0: @@ -605,16 +606,18 @@ class Desenho: h = self.d.sy - self.d.oldy if h < 0: h = - h + + self.d._set_selection_bounds(coords[0]-w/2, coords[1]-h/2, coords[0]+w/2, coords[1]+h/2) + - self.d.pixmap_temp.draw_rectangle(self.d.get_style().white_gc, True, x0, x1, w, h) - self.d.pixmap_temp.draw_drawable(self.d.gc, self.d.pixmap, x0, x1, coords[0] - w/2, coords[1]- h/2, w, h) + self.d.pixmap_sel.draw_rectangle(self.d.get_style().white_gc, True, x0, y0, w, h) + self.d.pixmap_sel.draw_drawable(self.d.gc, self.d.pixmap, x0, y0, coords[0] - w/2, coords[1]- h/2, w, h) + self.d.pixmap_temp.draw_drawable(self.d.gc, self.d.pixmap_sel,0,0,0,0, width, height) - self.d.pixmap_sel.draw_rectangle(self.d.get_style().white_gc, True, x0, x1, w, h) - self.d.pixmap_sel.draw_drawable(self.d.gc, self.d.pixmap, x0, x1, coords[0] - w/2, coords[1]- h/2, w, h) #to draw the selection black and white line rectangle self.d.pixmap_sel.draw_rectangle(self.d.gc_selection, False ,coords[0] - w/2, coords[1]- h/2, w, h) self.d.pixmap_sel.draw_rectangle(self.d.gc_selection1, False ,coords[0] - w/2-1, coords[1]- h/2-1, w+2, h+2) - + widget.queue_draw() diff --git a/NEWS b/NEWS index a919bcc..3b76917 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ 5 === +<<<<<<< .mine Added 'Clear' button (alexandre) +======= +Modifications on selection and gelection bounds (pekayatt) +>>>>>>> .r96 Added rainbow effect (andremossinato) Side number for regular polygon can be choosen (alexandre) New shape available: Heart (andremossinato) -- cgit v0.9.1