egui/widgets/text_edit/output.rs
1use std::sync::Arc;
2
3use crate::text::CursorRange;
4
5/// The output from a [`TextEdit`](crate::TextEdit).
6pub struct TextEditOutput {
7 /// The interaction response.
8 pub response: crate::Response,
9
10 /// How the text was displayed.
11 pub galley: Arc<crate::Galley>,
12
13 /// Where the text in [`Self::galley`] ended up on the screen.
14 pub galley_pos: crate::Pos2,
15
16 /// The text was clipped to this rectangle when painted.
17 pub text_clip_rect: crate::Rect,
18
19 /// The state we stored after the run.
20 pub state: super::TextEditState,
21
22 /// Where the text cursor is.
23 pub cursor_range: Option<CursorRange>,
24}
25
26impl TextEditOutput {
27 #[deprecated = "Renamed `self.galley_pos`"]
28 pub fn text_draw_pos(&self) -> crate::Pos2 {
29 self.galley_pos
30 }
31}
32
33// TODO(emilk): add `output.paint` and `output.store` and split out that code from `TextEdit::show`.