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:
Jim Fisher 2021-01-11 03:19:48 +00:00 committed by GitHub
parent 442f106bb4
commit 01b7ceac17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,6 +92,8 @@ Returns [`Point`](structures/point.md)
The current absolute position of the mouse pointer.
**Note:** The return value is a DIP point, not a screen physical point.
### `screen.getPrimaryDisplay()`
Returns [`Display`](structures/display.md) - The primary display.