Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Marc
Marc
@corpsmoderne@mamot.fr  ·  activity timestamp 5 hours ago

bump this because I'm still puzzled... 👆 #rustlang #ratatui .
I have an arbitrarily long Vec of Lines (logs), of which I want to display only the Nth lasts in a Paragraph... I don't know the height of the Paragraph as it takes all the available space in a "cell" of a layout...
if I use .scroll((logs.len() as u16, 0)) , no line is displayed, I should substrat the number of lines to display... which I don't know 🤔

  • Copy link
  • Flag this post
  • Block
Corey
Corey
@corey@hachyderm.io replied  ·  activity timestamp 3 hours ago

@corpsmoderne if you are using the Layout::split method, the resulting Rect does have “height”, which you can use to calculate scroll amount. Still a bit messy, but should work.

  • Copy link
  • Flag this comment
  • Block
Bobulous :rust: :codeberg:
Bobulous :rust: :codeberg:
@bobulous@fosstodon.org replied  ·  activity timestamp 4 hours ago

@corpsmoderne Perhaps @orhun might know how to help.

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.33 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct