unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: David Ponce <da_vid@orange.fr>
Cc: Eli Zaretskii <eliz@gnu.org>, 69992@debbugs.gnu.org
Subject: bug#69992: Minor improvement to image map transformation logic
Date: Sat, 30 Mar 2024 12:07:05 -0700	[thread overview]
Message-ID: <87bk6vcxoc.fsf@breatheoutbreathe.in> (raw)
In-Reply-To: <b02c9280-4fe1-46bf-b5d1-6a541a9dc1a9@orange.fr>


David Ponce <da_vid@orange.fr> writes:

> Here is my last patch. The only change compared to the previous patch is that
> now the scale factor is correctly calculated based on the size of the image and
> the displayed size. To minimize the performance impact, I saved a call to
> `image-size' by doing the calculation directly in the `image--compute-map' and
> `image--compute-original-map' functions. I did some benchmarks and the
> difference is not significant. The tests still give the same results :-)

Thank you for these fixes and optimizations!!! The tests pass for me.

> Here is the new change log:
>
> 2024-03-30  David Ponce  <da_vid@orange.fr>
>
> 	* lisp/image.el (image--compute-rotation): New function.
> 	(image--compute-map, image--compute-original-map): Use it.
> 	Ensure all transformations are applied or undone according to what
> 	Emacs does internally.  Call a transformation function only when
> 	needed.  Fix doc string.

With this fix, I think we can remove `image-tests--map-equal'. I'll
submit a new bug.

> 	(image--scale-map): Assume effective scale argument.
> 	(image--rotate-map): Assume effective rotation argument.
> 	(image--rotate-coord): Improve doc string.
> 	(image--flip-map): Remove no more used flip argument.
>
> 	* test/lisp/image-tests.el (image-create-image-with-map): Use a
> 	valid SVG image otherwise `image-size' will not return a valid
> 	value and calculation of scale could fail.
> 	(image-transform-map): Update according to changed signature of
> 	image--flip-map.
>
> Thanks!
>
> [2. text/x-patch; image-compute-map-V2.patch]...






      parent reply	other threads:[~2024-03-30 19:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  1:00 bug#69992: Minor improvement to image map transformation logic Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 11:16 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 12:50   ` Eli Zaretskii
2024-03-27 14:21     ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 22:17       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 23:53         ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 22:22         ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-29 10:19           ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30  8:10             ` Eli Zaretskii
2024-03-30  8:55               ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30 12:59                 ` David Ponce via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30 13:37                   ` Eli Zaretskii
2024-03-30 19:07                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=87bk6vcxoc.fsf@breatheoutbreathe.in \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69992@debbugs.gnu.org \
    --cc=da_vid@orange.fr \
    --cc=eliz@gnu.org \
    --cc=joseph@breatheoutbreathe.in \
    /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).