Skip to content

Commit 41c44a4

Browse files
authored
docs(frame): add docs about resize events (#697)
1 parent 1b8b626 commit 41c44a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/terminal.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,11 @@ pub struct Frame<'a> {
582582
impl Frame<'_> {
583583
/// The size of the current frame
584584
///
585-
/// This is guaranteed not to change when rendering.
585+
/// This is guaranteed not to change during rendering, so may be called multiple times.
586+
///
587+
/// If your app listens for a resize event from the backend, it should ignore the values from
588+
/// the event for any calculations that are used to render the current frame and use this value
589+
/// instead as this is the size of the buffer that is used to render the current frame.
586590
pub fn size(&self) -> Rect {
587591
self.viewport_area
588592
}

0 commit comments

Comments
 (0)