Skip to content
Snippets Groups Projects
Unverified Commit 01b7ceac authored by Jim Fisher's avatar Jim Fisher Committed by GitHub
Browse files

docs: coordinate system of badly named method getCursorScreenPoint (#27156)

* Document coordinate system of badly named method getCursorScreenPoint

[Electron inherits this confusing name from Chromium](https://github.com/chromium/chromium/blob/99314be8152e688bafbbf9a615536bdbb289ea87/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: default avatarCheng Zhao <zcbenz@gmail.com>
parent 442f106b
No related merge requests found
......@@ -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.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment