From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 69602@debbugs.gnu.org, stephen.berman@gmx.net, juri@linkov.net
Subject: bug#69602: 29.1; Image :map should adjust with :scale and :rotation
Date: Thu, 07 Mar 2024 00:08:57 -0800 [thread overview]
Message-ID: <87wmqelakx.fsf@breatheoutbreathe.in> (raw)
In-Reply-To: <86cys63281.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: 69602@debbugs.gnu.org, stephen.berman@gmx.net, juri@linkov.net
>> Date: Wed, 06 Mar 2024 23:14:21 -0800
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>> > The ELisp manual says about :map:
>> >
>> > Note that the map's coordinates should reflect the displayed image
>> > after all transforms have been done (rotation, scaling and so on),
>> > and also note that Emacs (by default) performs auto-scaling of
>> > images, so to make things match up, you should either specify
>> > ‘:scale 1.0’ when creating the image, or use the result of
>> > ‘image-compute-scaling-factor’ to compute the elements of the map.
>> >
>> > Can this technique help?
>>
>> Thank you for your help!
>>
>> When the user runs `image-increase-size', where should third-party code
>> recompute :map to fit the new image scale?
>>
>> There's no `image-after-change-size-hook' nor `image-after-rotate-hook'.
>
> I think the idea is to define the value of :map such that it runs
> image-compute-scaling-factor as part of computing the coordinates of
> the map.
Sorry, I don't understand.
When creating an image, we set its :map property according to the return
value of `image-compute-scaling-factor'. Once the image is inserted into
the buffer, the user may run `image-increase-size' or `image-rotate',
which changes how the image is displayed but not its :map.
Now, we need to rerun `image-compute-scaling-factor' and recompute :map.
However, there is no hook which runs after the user runs those commands,
so AFAICT there's no way for our code to know when to recompute :map.
Thanks!
Joseph
next prev parent reply other threads:[~2024-03-07 8:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 5:37 bug#69602: 29.1; Image :map should adjust with :scale and :rotation Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-07 7:04 ` Eli Zaretskii
2024-03-07 7:14 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-07 7:55 ` Eli Zaretskii
2024-03-07 8:08 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-03-07 9:27 ` Eli Zaretskii
2024-03-07 13:53 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-08 7:02 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-08 8:31 ` Eli Zaretskii
2024-03-08 8:39 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-08 11:50 ` Eli Zaretskii
2024-03-21 6:45 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-21 11:59 ` Eli Zaretskii
2024-03-23 0:11 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-23 7:58 ` Eli Zaretskii
2024-03-23 17:41 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-23 17:58 ` Eli Zaretskii
2024-03-23 18:18 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-23 20:32 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 10:13 ` Eli Zaretskii
2024-03-08 7:24 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wmqelakx.fsf@breatheoutbreathe.in \
--to=bug-gnu-emacs@gnu.org \
--cc=69602@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=joseph@breatheoutbreathe.in \
--cc=juri@linkov.net \
--cc=stephen.berman@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).