Permalink
Browse files

Merge branch 'zoom-option'

  • Loading branch information...
2 parents d9b4e3a + dbd17fd commit 88d3741db6b95751737edc99c06a11ba044acf94 @paulhammond committed Nov 26, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 webkit2png
View
@@ -213,6 +213,8 @@ examples:
cmdparser.add_option("--clipheight",type="float",default=150.0,
help="height of clipped thumbnail (default: 150)",
metavar="HEIGHT")
+ cmdparser.add_option("-z", "--zoom",type="float",default=1.0,
+ help="full page zoom of browser (default: 1.0)")
cmdparser.add_option("-s", "--scale",type="float",default=0.25,
help="scale factor for thumbnails (default: 0.25)")
cmdparser.add_option("-m", "--md5", action="store_true",
@@ -260,6 +262,7 @@ examples:
# (this might need to be larger so clipped image is right size)
options.initWidth = (options.clipwidth / options.scale)
options.initHeight = (options.clipheight / options.scale)
+ options.width *= options.zoom
if options.width>options.initWidth:
options.initWidth = options.width
if options.height>options.initHeight:
@@ -288,6 +291,9 @@ examples:
webview.preferences().setLoadsImagesAutomatically_(not options.noimages)
webview.preferences().setJavaScriptEnabled_(not options.nojs)
+ if options.zoom != 1.0:
+ webview._setZoomMultiplier_isTextOnly_(options.zoom, False)
+
# add the webview to the window
win.setContentView_(webview)

0 comments on commit 88d3741

Please sign in to comment.