Button clicked on mouse release
This commit is contained in:
parent
e1652bef77
commit
075fa7ab0f
1 changed files with 6 additions and 2 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue