#309 cleanup, fixes, optimizations

This commit is contained in:
Mikayla Fischler
2024-02-18 20:21:07 -05:00
parent 1a9892b291
commit 20bff48cfd
6 changed files with 94 additions and 96 deletions

View File

@@ -425,13 +425,11 @@ end
-- 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 height
---@param width integer character width
---@param height integer character height
---@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
function ppm.monitor_block_size(width, height)
return math.floor((width - 15) / 21) + 1, math.floor((height - 10) / 14) + 1
end
return ppm