docs: coordinate system of badly named method getCursorScreenPoint (#27156)
* Document coordinate system of badly named method getCursorScreenPoint
[Electron inherits this confusing name from Chromium](99314be815/ui/display/win/screen_win.cc (L677-L681)
). We can also see there that the return value is a DIPPoint, due to `ScreenToDIPPoint` call:
gfx::Point ScreenWin::GetCursorScreenPoint() {
POINT pt;
::GetCursorPos(&pt);
return gfx::ToFlooredPoint(ScreenToDIPPoint(gfx::PointF(gfx::Point(pt))));
}
I lost over a day due to debugging this. I don't think we can change the method name due to backwards compatibility, but we can at least make amends in the documentation.
* Remove advice
* Softer wording
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
parent
442f106bb4
commit
01b7ceac17
1 changed files with 2 additions and 0 deletions
|
@ -92,6 +92,8 @@ Returns [`Point`](structures/point.md)
|
||||||
|
|
||||||
The current absolute position of the mouse pointer.
|
The current absolute position of the mouse pointer.
|
||||||
|
|
||||||
|
**Note:** The return value is a DIP point, not a screen physical point.
|
||||||
|
|
||||||
### `screen.getPrimaryDisplay()`
|
### `screen.getPrimaryDisplay()`
|
||||||
|
|
||||||
Returns [`Display`](structures/display.md) - The primary display.
|
Returns [`Display`](structures/display.md) - The primary display.
|
||||||
|
|
Loading…
Reference in a new issue