--[[
  @package   eg4-crank-ui-2
  @file      screen-size.lua
  @brief     Functions to get the screen size
]]

---
--- @brief Get the screen width
--- @return The screen width
local screen_width
function get_screen_width()
  if not screen_width then
    screen_width = gre.env("screen_width")
  end
  return screen_width
end

---
--- @brief Get the screen height
--- @return The screen height
local screen_height
function get_screen_height()
  if not screen_height then
    screen_height = gre.env("screen_height")
  end
  return screen_height
end

---
--- @brief Get the screen size
--- @return Map of screen width and height
function get_screen_size()
  return { width = get_screen_width(), height = get_screen_height() }
end