mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-02 06:45:45 +03:00
ui: Account for padding on markdown renderer.
This commit is contained in:
parent
eea339545c
commit
f9b9bc04cc
@ -122,8 +122,9 @@ impl Component for Markdown {
|
||||
|
||||
fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> {
|
||||
let contents = tui::text::Text::from(self.contents.clone());
|
||||
let width = std::cmp::min(contents.width() as u16, viewport.0);
|
||||
let height = std::cmp::min(contents.height() as u16, viewport.1);
|
||||
let padding = 2;
|
||||
let width = std::cmp::min(contents.width() as u16 + padding, viewport.0);
|
||||
let height = std::cmp::min(contents.height() as u16 + padding, viewport.1);
|
||||
Some((width, height))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user