1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-28 10:56:36 +00:00

* lisp/doc-view.el (doc-view-guess-paper-size)

(doc-view-scale-bounding-box): Fix unbound `caddr'.
This commit is contained in:
Stefan Monnier 2012-09-19 13:54:59 -04:00
parent db8a5a189e
commit 46624b4fa1
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2012-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
* doc-view.el (doc-view-guess-paper-size)
(doc-view-scale-bounding-box): Fix unbound `caddr'.
2012-09-19 Tassilo Horn <tsdh@gnu.org>
New feature: set optimal slice from BoundingBox information.

View File

@ -1068,15 +1068,15 @@ dragging it to its bottom-right corner. See also
(round (/ (* 100.0 x) y))))
(let ((ar (div iw ih))
(al (mapcar (lambda (l)
(list (div (cadr l) (caddr l)) (car l)))
(list (div (nth 1 l) (nth 2 l)) (car l)))
doc-view-paper-sizes)))
(cadr (assoc ar al)))))
(defun doc-view-scale-bounding-box (ps iw ih bb)
(list (/ (* (nth 0 bb) iw) (cadr (assoc ps doc-view-paper-sizes)))
(/ (* (nth 1 bb) ih) (caddr (assoc ps doc-view-paper-sizes)))
(/ (* (nth 2 bb) iw) (cadr (assoc ps doc-view-paper-sizes)))
(/ (* (nth 3 bb) ih) (caddr (assoc ps doc-view-paper-sizes)))))
(list (/ (* (nth 0 bb) iw) (nth 1 (assoc ps doc-view-paper-sizes)))
(/ (* (nth 1 bb) ih) (nth 2 (assoc ps doc-view-paper-sizes)))
(/ (* (nth 2 bb) iw) (nth 1 (assoc ps doc-view-paper-sizes)))
(/ (* (nth 3 bb) ih) (nth 2 (assoc ps doc-view-paper-sizes)))))
(defun doc-view-set-slice-from-bounding-box (&optional force-paper-size)
"Set the slice from the document's BoundingBox information.