1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Add rect field to InteractInfo struct

This commit is contained in:
Emil Ernerfeldt
2019-01-14 14:26:02 +01:00
parent 6e8cc8439b
commit 3f84836c20
7 changed files with 73 additions and 89 deletions

View File

@@ -89,6 +89,9 @@ pub struct InteractInfo {
/// The mouse is interacting with this thing (e.g. dragging it)
pub active: bool,
/// The region of the screen we are talking about
pub rect: Rect,
}
#[derive(Clone, Debug, Serialize)]
@@ -97,29 +100,24 @@ pub enum GuiCmd {
/// The background for a button
Button {
interact: InteractInfo,
rect: Rect,
},
Checkbox {
checked: bool,
interact: InteractInfo,
rect: Rect,
},
/// The header button background for a foldable region
FoldableHeader {
interact: InteractInfo,
open: bool,
rect: Rect,
},
RadioButton {
checked: bool,
interact: InteractInfo,
rect: Rect,
},
Slider {
interact: InteractInfo,
max: f32,
min: f32,
rect: Rect,
value: f32,
},
/// Paint a single line of mono-space text.
@@ -167,8 +165,7 @@ pub enum PaintCmd {
corner_radius: f32,
fill_color: Option<Color>,
outline: Option<Outline>,
pos: Vec2,
size: Vec2,
rect: Rect,
},
/// Paint a single line of text
Text {