Open orhun opened 2 months ago
In the meantime I came up a workaround like so:
if let Component::TextComponent(c) = child {
let mut c = c.clone();
c.set_y_offset(c.y_offset() + 2); // shift the text
frame.render_widget(c, area);
}
Well that workaround does not really work well with scrolling :/ I get the same issue.
Hmmm. Could you provide an example where I could test it?
To test it you can try the updated code that I shared in the initial comment above.
Or you can watch towards the end of the this stream (after 1hr 10m) to see me struggle about this :D
I updated the workaround to skip rendering when the components are out of the render area: https://github.com/orhun/git-cliff/commit/65327c0aed9fded7dd7536ceb70474e87586f0e4
Again, this is something that I experienced in #150
I want to add a vertical padding to the rendered area so that it is not at y:0 all the time.
I modified the example (
demo.rs
) like so:https://github.com/orhun/md-tui/blob/e0a5778d364775304c112562489329f55c45e68b/examples/demo.rs#L76
So that markdown should be rendered starting from the half of the screen. However:
It is sitting still at Y:0
I think this is about clipping the upper bounds of Y, reference: https://github.com/henriklovhaug/md-tui/blob/abb51636ca5df433b7060a7624b7d24cdf0b0ab7/src/pages/markdown_renderer.rs#L42
Or somewhere in there Y is reseted to 0