r19050 by gpittman - fixed ability to select more than one frame with Align_image... script

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 20 02:28:26 UTC 2014


Author: gpittman
Date: Sun Apr 20 02:28:25 2014
New Revision: 19050

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19050
Log:
fixed ability to select more than one frame with Align_image... script

Modified:
    branches/Version14x/Scribus/scribus/plugins/scriptplugin/scripts/Align_image_in_frame.py

Modified: branches/Version14x/Scribus/scribus/plugins/scriptplugin/scripts/Align_image_in_frame.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19050&path=/branches/Version14x/Scribus/scribus/plugins/scriptplugin/scripts/Align_image_in_frame.py
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/scriptplugin/scripts/Align_image_in_frame.py (original)
+++ branches/Version14x/Scribus/scribus/plugins/scriptplugin/scripts/Align_image_in_frame.py Sun Apr 20 02:28:25 2014
@@ -7,14 +7,12 @@
 or bottom left, bottom center, bottom right.
  
 USAGE
-Select one image frames. Run the script, which asks for your alignment 
+Select one or more image frames. Run the script, which asks for your alignment 
 choice (all selected frames will need to have the same alignment). Choose the 
-position in the dialog radio button grid, click Align. Image are aligned, and script quits.
+position in the dialog radio button grid, click Align. Image(s) are aligned, and script quits.
  
 Note
 There is minimal error checking, in particular no checking for frame type.
-Although intended to work on more than one selected frame, there is a bug such that
-both images will be assigned the same scale.
 
 See the wiki page for further info:
 wiki.scribus.net/canvas/Align_an_Image_in_its_Frame
@@ -44,7 +42,7 @@
         self.key = 'English'
         Frame.__init__(self, master)
         self.grid()
-        self.master.geometry('150x150-40+50')
+        self.master.geometry('120x120-80+40')
         self.master.title('Scribus Image Alignment Wizard')
         #define widgets
         # alignment options
@@ -91,9 +89,11 @@
             objList = []
             for i in range(nbrSelected):
                 objList.append(scribus.getSelectedObject(i))
+            scribus.deselectAll()
             for i in range(nbrSelected):
                 try:
                     obj = objList[i]
+                    scribus.selectObject(obj)
                     frameW, frameH = scribus.getSize(obj)
                     saveScaleX, saveScaleY = scribus.getImageScale(obj)
                     scribus.setScaleImageToFrame(1, 0, obj)
@@ -121,6 +121,7 @@
                     scribus.setImageOffset(imageX, imageY, obj)
                     scribus.docChanged(1)
                     scribus.setRedraw(True)
+                    scribus.deselectAll()
                 except:
                     nothing = "nothing"
 	    scribus.setUnit(restore_units)




More information about the scribus-commit mailing list