mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
(feat): Add option to set max FPS (#578)
* (feat): add option for setting FPS on renderer Co-authored-by: Christian Rocha <christian@rocha.is>
This commit is contained in:
@@ -200,3 +200,12 @@ func WithFilter(filter func(Model, Msg) Msg) ProgramOption {
|
||||
p.filter = filter
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxFPS sets a custom maximum FPS at which the renderer should run. If
|
||||
// less than 1, the default value of 60 will be used. If over 120, the FPS
|
||||
// will be capped at 120.
|
||||
func WithFPS(fps int) ProgramOption {
|
||||
return func(p *Program) {
|
||||
p.fps = fps
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user