Hello:<br>A new patch to Paint. I don't know who is the mainteiner of this activity.<br>Who can commit these changes and close the bugs?<br>Thanks <br><br>Gonzalo<br><br>From f4a375b4861ca084ee03089751de82fc61233997 Mon Sep 17 00:00:00 2001<br>
From: Gonzalo Odiard <<a href="mailto:godiard@gmail.com">godiard@gmail.com</a>><br>Date: Thu, 20 May 2010 01:12:54 -0300<br>Subject: [PATCH] fix #931<br><br>---<br> Area.py | 5 +++--<br> toolbox.py | 19 ++++++++++++++++++-<br>
2 files changed, 21 insertions(+), 3 deletions(-)<br><br>diff --git a/Area.py b/Area.py<br>index 613e66e..611f944 100644<br>--- a/Area.py<br>+++ b/Area.py<br>@@ -155,6 +155,7 @@ class Area(gtk.DrawingArea):<br> self.line_shape = 'circle'<br>
self.last = []<br> self.rainbow_counter = 0<br>+ self.keep_aspect_ratio = False<br> <br> self.font = pango.FontDescription('Sans 9')<br> self._set_selection_bounds(0,0,0,0)<br>
@@ -378,7 +379,7 @@ class Area(gtk.DrawingArea):<br> self.d.square(widget,event,coords,True,self.tool['fill'])<br> <br> elif self.tool['name'] == 'marquee-rectangular' and not self.selmove:<br>
- if state & gtk.gdk.CONTROL_MASK:<br>+ if (state & gtk.gdk.CONTROL_MASK) or self.keep_aspect_ratio:<br> coords = self._keep_selection_ratio(coords)<br>
self.d.selection(widget,coords)<br> # selected<br>@@ -462,7 +463,7 @@ class Area(gtk.DrawingArea):<br> <br> elif self.tool['name'] == 'marquee-rectangular':<br>
if self.selmove == False:<br>- if event.state & gtk.gdk.CONTROL_MASK:<br>+ if (event.state & gtk.gdk.CONTROL_MASK) or self.keep_aspect_ratio:<br> coords = self._keep_selection_ratio(coords)<br>
self.d.selection(widget,coords,False)<br> self.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR))<br>diff --git a/toolbox.py b/toolbox.py<br>index 3962b90..6a01a72 100644<br>--- a/toolbox.py<br>
+++ b/toolbox.py<br>@@ -357,6 +357,11 @@ class ToolsToolbar(gtk.Toolbar):<br> self._tool_marquee_rectangular = ToolButton('tool-marquee-rectangular')<br> self.insert(self._tool_marquee_rectangular, -1)<br>
self._tool_marquee_rectangular.set_tooltip(_('Rectangular Marquee'))<br>+ try:<br>+ self._configure_palette(self._tool_marquee_rectangular, self._TOOL_MARQUEE_RECTANGULAR)<br>+ except:<br>
+ logging.debug('Could not create palette for tool Rectangular Marquee')<br>+<br> <br> # New connect method<br> # Using dictionnaries to control tool's properties<br>
@@ -483,7 +488,7 @@ class ToolsToolbar(gtk.Toolbar):<br> label.show()<br> <br> colorbutton = ButtonFillColor(self._activity)<br>- colorbutton.show()<br>+ colorbutton.show_all()<br>
<br> hbox.pack_start(label)<br> hbox.pack_start(colorbutton)<br>@@ -493,8 +498,20 @@ class ToolsToolbar(gtk.Toolbar):<br> content_box.pack_start(hbox)<br> <br> colorbutton.connect_after('color-set', self._on_color_set, self._TOOL_POLYGON)<br>
+ if tool['name'] is self._TOOL_MARQUEE_RECTANGULAR['name']:<br>+ # Creating a CheckButton named "Fill".<br>+ keep_aspect_checkbutton = gtk.CheckButton(_('Keep aspect'))<br>
+ keep_aspect_checkbutton.show()<br>+ keep_aspect_checkbutton.set_active(self._activity.area.keep_aspect_ratio)<br>+ <br>+ keep_aspect_checkbutton.connect('toggled', self._keep_aspect_checkbutton_toggled, widget)<br>
+ palette.action_bar.pack_start(keep_aspect_checkbutton)<br> <br> <br>+ def _keep_aspect_checkbutton_toggled(self, checkbutton, button=None):<br>+ logging.debug('Keep aspect is Active: %s', checkbutton.get_active())<br>
+ self._activity.area.keep_aspect_ratio = checkbutton.get_active()<br>+<br> def set_shape(self, widget=None, tool=None, shape=None):<br> """<br> Set a tool shape according to user choice at Tool Palette<br>
-- <br>1.6.6.1<br><br clear="all"><br>-- <br>Gonzalo Odiard<br>Responsable de Desarrollo<br>Sistemas Australes<br><br>