LogicalPosition
Defined in: dpi.ts:214
A position represented in logical pixels.
For an explanation of what logical pixels are, see description of LogicalSize.
2.0.0
new LogicalPosition(
x,y):LogicalPosition
Defined in: dpi.ts:219
number
number
LogicalPosition
new LogicalPosition(
object):LogicalPosition
Defined in: dpi.ts:220
{ x: number; y: number; }
number
number
LogicalPosition
new LogicalPosition(
object):LogicalPosition
Defined in: dpi.ts:221
number
number
LogicalPosition
readonlytype:"Logical"='Logical'
Defined in: dpi.ts:215
x:
number
Defined in: dpi.ts:216
y:
number
Defined in: dpi.ts:217
__TAURI_TO_IPC_KEY__():
object
Defined in: dpi.ts:261
object
x:
number
y:
number
toJSON():
object
Defined in: dpi.ts:268
object
x:
number
y:
number
toPhysical(
scaleFactor):PhysicalPosition
Defined in: dpi.ts:257
Converts the logical position to a physical one.
number
import { LogicalPosition } from '@tauri-apps/api/dpi';import { getCurrentWindow } from '@tauri-apps/api/window';
const appWindow = getCurrentWindow();const factor = await appWindow.scaleFactor();const position = new LogicalPosition(400, 500);const physical = position.toPhysical(factor);2.0.0
© 2025 Tauri Contributors. CC-BY / MIT