MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ConvertDipsToPixels

Function ConvertDipsToPixels

Source/Engine/Platform/UWP/UWPWindow.cpp:90–94  ·  view source on GitHub ↗

Converts a length in device-independent pixels (DIPs) to a length in physical pixels.

Source from the content-addressed store, hash-verified

88
89// Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
90inline float ConvertDipsToPixels(float dips, float dpi)
91{
92 static const float dipsPerInch = 96.0f;
93 return floorf(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
94}
95
96// Converts a length in physical pixels to a length in device-independent pixels (DIPs) using the provided DPI. This removes the need
97// to call this function from a thread associated with a CoreWindow, which is required by DisplayInformation::GetForCurrentView().

Callers 1

OnSizeChangeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected