I mean pressing + or - moves the page horizontally, instead of changing the size. I think the way it opens the document is ok.I'll have a look at the patch and let you know.EvgeniOn Thu, Mar 7, 2013 at 3:55 PM, Tassilo Horn <tsdh@gnu.org> wrote:
E Sabof <esabof@gmail.com> writes:Does that mean that you'd like to set the hscoll when the window is
> I had a look at it, there are some issues with zooming. It doesn't
> work when I open a document that is larger than the window,
smaller than the images so that the center of the image is displayed at
the center of the window?
Hm, this could at least be done once when initially opening some
document. When switching pages, the current hscroll is preserved and I
consider that a good thing. It shouldn't re-center then.
I know there were some issues/errors when the image of a page isn't
> and sometimes in other cases.
there already. That should be fixed by this version of the patch.
+++ lisp/doc-view.el 2013-03-07 08:14:09 +0000
--8<---------------cut here---------------start------------->8---
=== modified file 'lisp/doc-view.el'
--- lisp/doc-view.el 2013-02-28 04:02:36 +0000
@@ -1250,7 +1250,7 @@
(when doc-view-pending-cache-flush+ (let* ((ol (doc-view-current-overlay))
(clear-image-cache)
(setq doc-view-pending-cache-flush nil))
- (let ((ol (doc-view-current-overlay))
(image (if (and file (file-readable-p file))(if (not (and doc-view-scale-internally
(fboundp 'imagemagick-types)))
@@ -1258,9 +1258,20 @@
(unless (member :width args)
(setq args `(,@args :width ,doc-view-image-width)))
(apply 'create-image file 'imagemagick nil args))))+ (slice (doc-view-current-slice))
- (slice (doc-view-current-slice)))
+ (img-width (and image (car (image-size image))))
+ (displayed-img-width (if (and image slice)
+ (* (/ (float (nth 2 slice))+ (when (and image (> window-width displayed-img-width))
+ (car (image-size image 'pixels)))
+ img-width)
+ img-width))
+ (window-width (window-width (selected-window))))
(setf (doc-view-current-image) image)
(move-overlay ol (point-min) (point-max))
+ (overlay-put ol 'before-string--8<---------------cut here---------------end--------------->8---
+ (propertize " " 'display
+ `(space :align-to (+ center (-0.5 . ,displayed-img-width))))))
(overlay-put ol 'display
(cond
(image
Bye,
Tassilo