LogicalPosition
이 콘텐츠는 아직 번역되지 않았습니다.
Module @netwiv/api/window · Kind Class
import { LogicalPosition } from '@netwiv/api/window';A position represented in logical pixels. For an explanation of what logical pixels are, see description of {@linkcode LogicalSize}.
Constructor
Section titled “Constructor”new LogicalPosition(x: number, y: number)new LogicalPosition(object: { Logical: { x: number; y: number; }; })new LogicalPosition(object: { x: number; y: number; })Instance members
Section titled “Instance members”toJSON
Section titled “toJSON”toJSON(): { x: number; y: number; }toPhysical
Section titled “toPhysical”toPhysical(scaleFactor: number): PhysicalPositionConverts the logical position to a physical one.
Example
import { LogicalPosition } from '@netwiv/api/dpi';import { getCurrentWindow } from '@netwiv/api/window';
const appWindow = getCurrentWindow();const factor = await appWindow.scaleFactor();const position = new LogicalPosition(400, 500);const physical = position.toPhysical(factor);readonly type: "Logical"x: numbery: numberUpstream since 2.0.0
Descriptions come from the pinned @tauri-apps/api@2.11.1 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.