mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(image): better cell size calculation for non-HDPI displays
This commit is contained in:
parent
4e13b24e99
commit
e146a66cb7
2 changed files with 5 additions and 5 deletions
|
@ -117,9 +117,9 @@ local defaults = {
|
|||
---@type table<string,snacks.image.args>
|
||||
magick = {
|
||||
default = { "{src}[0]", "-scale", "1920x1080>" }, -- default for raster images
|
||||
vector = { "-density", 300, "{src}[0]" }, -- used by vector images like svg
|
||||
math = { "-density", 300, "{src}[0]", "-trim" },
|
||||
pdf = { "-density", 300, "{src}[0]", "-background", "white", "-alpha", "remove", "-trim" },
|
||||
vector = { "-density", 192, "{src}[0]" }, -- used by vector images like svg
|
||||
math = { "-density", 192, "{src}[0]", "-trim" },
|
||||
pdf = { "-density", 192, "{src}[0]", "-background", "white", "-alpha", "remove", "-trim" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ end
|
|||
---@return snacks.image.Size
|
||||
function M.norm(size)
|
||||
return {
|
||||
width = math.max(1, math.floor(size.width + 0.5)),
|
||||
height = math.max(1, math.floor(size.height + 0.5)),
|
||||
width = math.max(1, math.ceil(size.width)),
|
||||
height = math.max(1, math.ceil(size.height)),
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue