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

Make emigui fill entire web page

This commit is contained in:
Emil Ernerfeldt
2020-04-23 22:08:42 +02:00
parent 1affa10dee
commit 7459aa60a4
4 changed files with 9 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ pub struct GuiInput {
pub mouse_released: bool,
/// Current position of the mouse in points.
/// None for touch screens when finger is not down.
pub mouse_pos: Option<Pos2>,
/// How much the mouse moved compared to last frame, in points.
@@ -71,7 +72,7 @@ impl GuiInput {
.and_then(|new| last.mouse_pos.map(|last| new - last))
.unwrap_or_default();
GuiInput {
mouse_down: new.mouse_down,
mouse_down: new.mouse_down && new.mouse_pos.is_some(),
mouse_pressed: !last.mouse_down && new.mouse_down,
mouse_released: last.mouse_down && !new.mouse_down,
mouse_pos: new.mouse_pos,