File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ import { SERIALIZE_TO_IPC_FN } from './core'
6
6
7
7
/**
8
8
* A size represented in logical pixels.
9
+ * Logical pixels are scaled according to the window's DPI scale.
10
+ * Most browser APIs (i.e. `MouseEvent`'s `clientX`) will return logical pixels.
11
+ *
12
+ * For logical-pixel-based position, see {@linkcode LogicalPosition}.
9
13
*
10
14
* @since 2.0.0
11
15
*/
@@ -72,6 +76,12 @@ class LogicalSize {
72
76
/**
73
77
* A size represented in physical pixels.
74
78
*
79
+ * Physical pixels represent actual screen pixels, and are DPI-independent.
80
+ * For high-DPI windows, this means that any point in the window on the screen
81
+ * will have a different position in logical pixels (@linkcode LogicalSize).
82
+ *
83
+ * For physical-pixel-based position, see {@linkcode PhysicalPosition}.
84
+ *
75
85
* @since 2.0.0
76
86
*/
77
87
class PhysicalSize {
@@ -197,6 +207,7 @@ class Size {
197
207
198
208
/**
199
209
* A position represented in logical pixels.
210
+ * For an explanation of what logical pixels are, see description of {@linkcode LogicalSize}.
200
211
*
201
212
* @since 2.0.0
202
213
*/
@@ -263,6 +274,8 @@ class LogicalPosition {
263
274
/**
264
275
* A position represented in physical pixels.
265
276
*
277
+ * For an explanation of what physical pixels are, see description of {@linkcode PhysicalSize}.
278
+ *
266
279
* @since 2.0.0
267
280
*/
268
281
class PhysicalPosition {
Original file line number Diff line number Diff line change @@ -213,7 +213,8 @@ export class Menu extends MenuItemBase {
213
213
/**
214
214
* Popup this menu as a context menu on the specified window.
215
215
*
216
- * If the position, is provided, it is relative to the window's top-left corner.
216
+ * @param at If a position is provided, it is relative to the window's top-left corner.
217
+ * If there isn't one provided, the menu will pop up at the current location of the mouse.
217
218
*/
218
219
async popup (
219
220
at ?: PhysicalPosition | LogicalPosition | Position ,
You can’t perform that action at this time.
0 commit comments