mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Fix a performance rendering size miscalculation in the pager example
This commit is contained in:
@@ -101,10 +101,15 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
// quickly, though asynchronously, which is why we wait for them
|
||||
// here.
|
||||
m.viewport = viewport.Model{Width: msg.Width, Height: msg.Height - verticalMargins}
|
||||
m.viewport.YPosition = headerHeight
|
||||
m.viewport.HighPerformanceRendering = useHighPerformanceRenderer
|
||||
m.viewport.SetContent(m.content)
|
||||
m.ready = true
|
||||
|
||||
// This is only necessary for high performance rendering, which in
|
||||
// most cases you won't need.
|
||||
//
|
||||
// Render the viewport one line below the header.
|
||||
m.viewport.YPosition = headerHeight + 1
|
||||
} else {
|
||||
m.viewport.Width = msg.Width
|
||||
m.viewport.Height = msg.Height - verticalMargins
|
||||
|
||||
Reference in New Issue
Block a user