mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
705c898ccd
* Updating all assets to new coding style * Cleaning up asset files * Moving default_actions and default_keybindings files * Changing procedural globes to explicitly specified globes * Move Spice loading explicitly to the initialize part and also deinitialize * Removing unused asset files * Removing asset_helper * Removing scale_model_helper asset * Removing script_scheduler_helper * Removing testing_keybindings * Remove procedural_globe
40 lines
1.1 KiB
Lua
40 lines
1.1 KiB
Lua
asset.onInitialize(function()
|
|
local scale = openspace.dpiScaling()
|
|
openspace.printInfo("Setting the DPI scaling factor to " .. tostring(scale))
|
|
|
|
|
|
if openspace.modules.isLoaded("CefWebGui") then
|
|
openspace.setPropertyValueSingle(
|
|
"Modules.CefWebGui.GuiScale",
|
|
openspace.getPropertyValue("Modules.CefWebGui.GuiScale") * scale
|
|
)
|
|
end
|
|
|
|
local dashboards = openspace.getProperty("Dashboard.*.FontSize")
|
|
for _, v in ipairs(dashboards) do
|
|
openspace.setPropertyValueSingle(
|
|
v,
|
|
openspace.getPropertyValue(v) * scale
|
|
)
|
|
end
|
|
|
|
local offset = openspace.getPropertyValue("Dashboard.StartPositionOffset")
|
|
openspace.setPropertyValueSingle(
|
|
"Dashboard.StartPositionOffset",
|
|
{ offset[1] * scale, offset[2] * scale }
|
|
)
|
|
end)
|
|
|
|
|
|
|
|
asset.meta = {
|
|
Name = "DPI Scaling",
|
|
Version = "1.0",
|
|
Description = [[Retrieves the DPI scaling from the operating system and applies it to a
|
|
few selected places to make them scale better on "large resolution but small size"
|
|
monitors]],
|
|
Author = "OpenSpace Team",
|
|
URL = "http://openspaceproject.com",
|
|
License = "MIT license"
|
|
}
|