#309 moved monitor block size to ppm and fixed size estimation for monitor requirements

This commit is contained in:
Mikayla Fischler
2024-02-18 13:00:18 -05:00
parent 1fa8c03dff
commit 3e83c8e2c6
3 changed files with 18 additions and 10 deletions

View File

@@ -421,4 +421,17 @@ function ppm.get_monitor_list()
return list
end
-- HELPER FUNCTIONS
-- get the block size of a monitor given its width and height <b>at a text scale of 0.5</b>
---@nodiscard
---@param w integer character width
---@param h integer character width
---@return integer block_width, integer block_height
function ppm.monitor_block_size(w, h)
local width = math.floor((w - 15) / 21) + 1
local height = math.floor((h - 10) / 14) + 1
return width, height
end
return ppm