mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Button clicked on mouse release
This commit is contained in:
@@ -303,6 +303,10 @@ impl Region {
|
|||||||
self.available_space.x
|
self.available_space.x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn height(&self) -> f32 {
|
||||||
|
self.available_space.y
|
||||||
|
}
|
||||||
|
|
||||||
pub fn direction(&self) -> Direction {
|
pub fn direction(&self) -> Direction {
|
||||||
self.dir
|
self.dir
|
||||||
}
|
}
|
||||||
@@ -543,9 +547,8 @@ impl Region {
|
|||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
let clicked = hovered && self.input().mouse_clicked;
|
|
||||||
let active = if interaction_id.is_some() {
|
let active = if interaction_id.is_some() {
|
||||||
if clicked {
|
if hovered && self.input().mouse_clicked {
|
||||||
memory.active_id = interaction_id;
|
memory.active_id = interaction_id;
|
||||||
}
|
}
|
||||||
memory.active_id == interaction_id
|
memory.active_id == interaction_id
|
||||||
@@ -553,6 +556,7 @@ impl Region {
|
|||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let clicked = hovered && self.input().mouse_released;
|
||||||
InteractInfo {
|
InteractInfo {
|
||||||
rect,
|
rect,
|
||||||
hovered,
|
hovered,
|
||||||
|
|||||||
Reference in New Issue
Block a user