summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJoseph Turner <joseph@breatheoutbreathe.in>2024-03-07 21:55:00 -0800
committerEli Zaretskii <eliz@gnu.org>2024-03-23 19:54:53 +0200
commit79c758187cef7fc1f93fd525b9d81be81ee2b2cc (patch)
tree99534fe047ef9221b5b1aeb366f346b5ddd5dc90 /etc
parent4b0f5cdb01fbd05c8184a89fa8543eb5600fb4f8 (diff)
downloademacs-79c758187cef7fc1f93fd525b9d81be81ee2b2cc.tar.gz
Recompute :map when image :scale, :rotation, or :flip changes
Now, when transforming an image, its :map is recomputed to fit. Image map coordinates are integers, so when computing :map, coordinates are rounded. To prevent an image from drifting from its map after repeated transformations, 'create-image' now adds a new image property :original-map, which is combined with the image's transformation parameters to recompute :map. * lisp/image.el (image-recompute-map-p): Add user option to control whether :map is recomputed when an image is transformed. (create-image): Create :map from :original-map and vice versa. (image--delayed-change-size): Fix comment. (image--change-size, image-rotate, image-flip-horizontally, image-flip-vertically): Recompute image map after transformation and mention 'image-recompute-map-p' in docstring. (image--compute-map): Add function to compute a map from original map. (image--compute-original-map): Add function to compute an original map from map. (image--scale-map): Add function to scale a map based on :scale. (image--rotate-map): Add function to rotate a map based on :rotation. (image--rotate-coord): Add function to rotate a map coordinate pair. (image--flip-map): Add function to flip a map based on :flip. (image-increase-size, image-decrease-size, image-mouse-increase-size) (image-mouse-decrease-size): Mention 'image-recompute-map-p' in docstrings. * etc/NEWS: Add NEWS entry. * doc/lispref/display.texi (Image Descriptors): Document :original-map and new user option 'image-recompute-map-p'. * test/lisp/image-tests.el (image--compute-map-and-original-map): Test 'image--compute-map' and 'image--compute-original-map'. (image-tests--map-equal): Add equality predicate to compare image maps. (image-create-image-with-map): Test that 'create-image' adds :map and/or :original-map as appropriate. (image-transform-map): Test functions related to transforming maps. (Bug#69602)
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS12
1 files changed, 12 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index c6b654a9d3b..19588fe8eeb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1368,6 +1368,18 @@ without specifying a file, like this:
(notifications-notify
:title "I am playing music" :app-icon 'multimedia-player)
+** Image
+
++++
+*** Image :map property is now recomputed when image is transformed.
+Now images with clickable maps work as expected after you run commands
+such as `image-increase-size', `image-decrease-size', `image-rotate',
+`image-flip-horizontally', and `image-flip-vertically'.
+
++++
+*** New user option 'image-recompute-map-p'
+Set this option to nil to prevent Emacs from recomputing image maps.
+
** Image Dired
*** New user option 'image-dired-thumb-naming'.