mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
file-name-resolver module
This commit is contained in:
@ -73,7 +73,9 @@ export class screen implements definition.screen {
|
||||
mainScreenInfo = {
|
||||
widthPixels: metrics.widthPixels,
|
||||
heightPixels: metrics.heightPixels,
|
||||
scale: metrics.density
|
||||
scale: metrics.density,
|
||||
widthDIPs: metrics.widthPixels / metrics.density,
|
||||
heightDIPs: metrics.heightPixels / metrics.density
|
||||
}
|
||||
}
|
||||
return mainScreenInfo;
|
||||
|
10
platform/platform.d.ts
vendored
10
platform/platform.d.ts
vendored
@ -61,6 +61,16 @@ declare module "platform" {
|
||||
*/
|
||||
heightPixels: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute width of the screen in density independent pixels.
|
||||
*/
|
||||
widthDIPs: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute height of the screen in density independent pixels.
|
||||
*/
|
||||
heightDIPs: number;
|
||||
|
||||
/**
|
||||
* The logical density of the display. This is a scaling factor for the Density Independent Pixel unit.
|
||||
*/
|
||||
|
@ -71,7 +71,9 @@ export class screen implements definition.screen {
|
||||
mainScreenInfo = {
|
||||
widthPixels: size.width * scale,
|
||||
heightPixels: size.height * scale,
|
||||
scale: scale
|
||||
scale: scale,
|
||||
widthDIPs: size.width,
|
||||
heightDIPs: size.height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user