GNU bug report logs -
#50487
Image :map area is not correct in Windows HiDPI environment
Previous Next
Reported by: tsuucat <tsuucat <at> icloud.com>
Date: Thu, 9 Sep 2021 17:07:01 UTC
Severity: normal
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 50487 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]
This bug report was last modified 2 years and 268 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.