unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50487: Image :map area is not correct in Windows HiDPI environment
@ 2021-09-09 17:05 tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-09-12  5:58 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-09 17:05 UTC (permalink / raw)
  To: 50487

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

Emacs version: 28.0.50

Window system: Windows (Windows 10)



Image descriptors :map can create hot-spot for an image.

The area will be specified as (rect . ((0 . 0) . (200 . 300))), but
this will not be reflected correctly in my HiDPI environment.


Reproduce steps:

1: eval following to insert image.

```

(require 'svg)
(let ((start (point))
      (end (progn (insert "x") (point))))
  (put-text-property
   start end 'display
   (let ((svg (svg-create 400 300)))
     (svg-rectangle svg 0 0 200 300 :fill "blue")
     (svg-rectangle svg 200 0 200 300 :fill "green")
     (svg-image svg :map '(((rect . ((0 . 0) . (200 . 300))) left-area (help-echo "left-area"))
               ((rect . ((200 . 0) . (400 . 300))) right-area (help-echo "right-area")))))))
```

2: move mouse cursor on image.

expected: when mouse is on blue rectangle area, tool-tip "left-area" appears.
actual: The area which tool-tip "left-area" appears doesn't match blue rectangle area.

The area which tool-tip "left-area"appears is smaller than expected.



My screen scale is 200%. If I change the scale to 100%, Emacs works
correctly. So I think this is HiDPI-related problem.



--

tsuucat

[-- Attachment #2.1: Type: text/html, Size: 2002 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#50487:  Image :map area is not correct in Windows HiDPI environment
  2021-09-09 17:05 bug#50487: Image :map area is not correct in Windows HiDPI environment tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-09-12  5:58 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-25 14:38   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-12  5:58 UTC (permalink / raw)
  To: 50487

[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]

Emacs version: 28.0.50

Window system: Windows (Windows 10)



Image descriptors :map can create hot-spot for an image.

The area will be specified as (rect . ((0 . 0) . (200 . 300))), but
this will not be reflected correctly in my HiDPI environment.


Reproduce steps:

1: eval following to insert image.

```

(require 'svg)
(let ((start (point))
      (end (progn (insert "x") (point))))
  (put-text-property
   start end 'display
   (let ((svg (svg-create 400 300)))
     (svg-rectangle svg 0 0 200 300 :fill "blue")
     (svg-rectangle svg 200 0 200 300 :fill "green")
     (svg-image svg :map '(((rect . ((0 . 0) . (200 . 300))) left-area (help-echo "left-area"))
               ((rect . ((200 . 0) . (400 . 300))) right-area (help-echo "right-area")))))))
```

2: move mouse cursor on image.

expected: when mouse is on blue rectangle area, tool-tip "left-area" appears.
actual: The area which tool-tip "left-area" appears doesn't match blue rectangle area.

The area which tool-tip "left-area"appears is smaller than expected.



My screen scale is 200%. If I change the scale to 100%, Emacs works
correctly. So I think this is HiDPI-related problem.


After more investigation, it seems that this is not a problem limited
to the Windows High DPI environment. Because the function `find_hot_spot`
does not take :scale value into account, the area appears to be misaligned.



Either find_hot_spot needs to be adapted to take :scale into account, or we
need to document that :map only works well when :scale is 1.0.


--

tsuucat

[-- Attachment #2.1: Type: text/html, Size: 2684 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#50487: Image :map area is not correct in Windows HiDPI environment
  2021-09-12  5:58 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-25 14:38   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-25 14:38 UTC (permalink / raw)
  To: tsuucat; +Cc: 50487

tsuucat <tsuucat@icloud.com> writes:

> After more investigation, it seems that this is not a problem limited
> to the Windows High DPI environment. Because the function `find_hot_spot` 
> does not take :scale value into account, the area appears to be misaligned.
>
> Either find_hot_spot needs to be adapted to take :scale into account, or we 
> need to document that :map only works well when :scale is 1.0.

I've now mentioned image transforms and :scale in the :map node in the
manual in Emacs 29.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-25 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 17:05 bug#50487: Image :map area is not correct in Windows HiDPI environment tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-12  5:58 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-25 14:38   ` Lars Ingebrigtsen

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).