summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-11-30 21:55:45 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-11-30 21:55:45 +0100
commite336f39ce7cb101d1fe735e2e35fb76d93bfe173 (patch)
tree6d828aa1a299437c7092543ccf1f4366c4d9e21b
parentc3146209ec752d516502b0fab258534436b0908f (diff)
downloadorg-mode-e336f39ce7cb101d1fe735e2e35fb76d93bfe173.tar.gz
Fix dpi calculation when previewing LaTeX snippets
* lisp/org.el (org--get-display-dpi): Fix docstring. (org-create-formula-image): Use function above. Reported-by: Scott Otterson <scotto@sharpleaf.org> <http://permalink.gmane.org/gmane.emacs.orgmode/110526>
-rw-r--r--lisp/org.el8
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 5763829..6651436 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19458,9 +19458,8 @@ inspection."
(defun org--get-display-dpi ()
"Get the DPI of the display.
-
-Assumes that the display has the same pixel width in the
-horizontal and vertical directions."
+The function assumes that the display has the same pixel width in
+the horizontal and vertical directions."
(if (display-graphic-p)
(round (/ (display-pixel-height)
(/ (display-mm-height) 25.4)))
@@ -19503,12 +19502,11 @@ a HTML file."
(texfilebase (make-temp-name
(expand-file-name "orgtex" tmpdir)))
(texfile (concat texfilebase ".tex"))
- (font-height (face-attribute 'default :height nil))
(image-size-adjust (or (plist-get processing-info :image-size-adjust)
'(1.0 . 1.0)))
(scale (* (if buffer (car image-size-adjust) (cdr image-size-adjust))
(or (plist-get options (if buffer :scale :html-scale)) 1.0)))
- (dpi (* scale (floor (if buffer font-height 140.0))))
+ (dpi (* scale (if buffer (org--get-display-dpi) 140.0)))
(fg (or (plist-get options (if buffer :foreground :html-foreground))
"Black"))
(bg (or (plist-get options (if buffer :background :html-background))