dpi
Classes
LogicalPosition
A position represented in logical pixels.
Since
2.0.0
Constructors
constructor()
new LogicalPosition(x, y): LogicalPositionParameters
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
Source: dpi.ts:62
Properties
| Property | Type |
|---|---|
type | string |
x | number |
y | number |
LogicalSize
A size represented in logical pixels.
Since
2.0.0
Constructors
constructor()
new LogicalSize(width, height): LogicalSizeParameters
| Parameter | Type |
|---|---|
width | number |
height | number |
Returns
Source: dpi.ts:15
Properties
| Property | Type |
|---|---|
height | number |
type | string |
width | number |
PhysicalPosition
A position represented in physical pixels.
Since
2.0.0
Constructors
constructor()
new PhysicalPosition(x, y): PhysicalPositionParameters
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
Source: dpi.ts:78
Properties
| Property | Type |
|---|---|
type | string |
x | number |
y | number |
Methods
toLogical()
toLogical(scaleFactor): LogicalPositionConverts the physical position to a logical one.
Example
import { getCurrent } from '@tauri-apps/api/window';const appWindow = getCurrent();const factor = await appWindow.scaleFactor();const position = await appWindow.innerPosition();const logical = position.toLogical(factor);Parameters
| Parameter | Type |
|---|---|
scaleFactor | number |
Returns
Source: dpi.ts:94
PhysicalSize
A size represented in physical pixels.
Since
2.0.0
Constructors
constructor()
new PhysicalSize(width, height): PhysicalSizeParameters
| Parameter | Type |
|---|---|
width | number |
height | number |
Returns
Source: dpi.ts:31
Properties
| Property | Type |
|---|---|
height | number |
type | string |
width | number |
Methods
toLogical()
toLogical(scaleFactor): LogicalSizeConverts the physical size to a logical one.
Example
import { getCurrent } from '@tauri-apps/api/window';const appWindow = getCurrent();const factor = await appWindow.scaleFactor();const size = await appWindow.innerSize();const logical = size.toLogical(factor);Parameters
| Parameter | Type |
|---|---|
scaleFactor | number |
Returns
Source: dpi.ts:47
© 2024 Tauri Contributors. CC-BY / MIT