]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue 25959: Explain in docstring that PhotoImage.zoom arguments are
authorTerry Jan Reedy <tjreedy@udel.edu>
Fri, 11 Mar 2016 20:30:35 +0000 (15:30 -0500)
committerTerry Jan Reedy <tjreedy@udel.edu>
Fri, 11 Mar 2016 20:30:35 +0000 (15:30 -0500)
multipliers, not final sizes.  Explain y default for .zoom and .subsample.
Initial patch by Serhiy Storchaka.

Lib/tkinter/__init__.py

index 8139e38452d2c3d84b69d8e2134d8c4c91ea30c3..da430dfd77ebc7618e2b528dce61a733cce4302c 100644 (file)
@@ -3407,16 +3407,20 @@ class PhotoImage(Image):
         destImage = PhotoImage(master=self.tk)
         self.tk.call(destImage, 'copy', self.name)
         return destImage
-    def zoom(self,x,y=''):
+    def zoom(self, x, y=''):
         """Return a new PhotoImage with the same image as this widget
-        but zoom it with X and Y."""
+        but zoom it with a factor of x in the X direction and y in the Y
+        direction.  If y is not given, the default value is the same as x.
+        """
         destImage = PhotoImage(master=self.tk)
         if y=='': y=x
         self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
         return destImage
-    def subsample(self,x,y=''):
+    def subsample(self, x, y=''):
         """Return a new PhotoImage based on the same image as this widget
-        but use only every Xth or Yth pixel."""
+        but use only every Xth or Yth pixel.  If y is not given, the
+        default value is the same as x.
+        """
         destImage = PhotoImage(master=self.tk)
         if y=='': y=x
         self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)