aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Porter2024-06-23 16:59:00 -0700
committerJim Porter2024-06-24 21:36:04 -0700
commit3abcfe013d809a8194f5158877fd43f11d714fd5 (patch)
treeafe42d647d59ab00841c906c69a70c21753ef42f
parentfeac6e298d596509ad5ad0b617873b0368c9d161 (diff)
downloademacs-3abcfe013d809a8194f5158877fd43f11d714fd5.tar.gz
emacs-3abcfe013d809a8194f5158877fd43f11d714fd5.zip
Fix rescaling of images via 'text-scale-mode' in EWW
* lisp/net/eww.el (eww--rescale-images): Handle a :scale of 'default' (bug#71741).
-rw-r--r--lisp/net/eww.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index fd8f80065b1..94bfd333fa9 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1371,12 +1371,16 @@ within text input fields."
1371 (goto-char (point-min)) 1371 (goto-char (point-min))
1372 (while-let ((match (text-property-search-forward 1372 (while-let ((match (text-property-search-forward
1373 'display nil (lambda (_ value) (imagep value))))) 1373 'display nil (lambda (_ value) (imagep value)))))
1374 (let ((image (prop-match-value match))) 1374 (let* ((image (prop-match-value match))
1375 (unless (image-property image :original-scale) 1375 (original-scale (or (image-property image :original-scale)
1376 (setf (image-property image :original-scale) 1376 (setf (image-property image :original-scale)
1377 (or (image-property image :scale) 1))) 1377 (or (image-property image :scale)
1378 'default)))))
1379 (when (eq original-scale 'default)
1380 (setq original-scale (image-compute-scaling-factor
1381 image-scaling-factor)))
1378 (setf (image-property image :scale) 1382 (setf (image-property image :scale)
1379 (* (image-property image :original-scale) scaling))))))) 1383 (* original-scale scaling)))))))
1380 1384
1381(defun eww--url-at-point () 1385(defun eww--url-at-point ()
1382 "`thing-at-point' provider function." 1386 "`thing-at-point' provider function."