Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hover_pos on touch screens #180

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reorder state assignment in show_inside
  • Loading branch information
ToppDev committed Sep 18, 2023
commit 62ec19de9ab676e0914db4471510337204d617ad
3 changes: 1 addition & 2 deletions src/widgets/dock_area/show/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ impl<'tree, Tab> DockArea<'tree, Tab> {
.get_or_insert(Style::from_egui(ui.style().as_ref()));
self.window_bounds.get_or_insert(ui.ctx().screen_rect());
let mut state = State::load(ui.ctx(), self.id);
let style = self.style.as_ref().unwrap();

// Delay hover position one frame. On touch screens hover_pos() is None when any_released()
if !ui.input(|i| i.pointer.any_released()) {
state.last_hover_pos = ui.input(|i| i.pointer.hover_pos());
}

let style = self.style.as_ref().unwrap();
let fade_surface =
self.hovered_window_surface(&mut state, style.overlay.feel.fade_hold_time, ui.ctx());
let fade_style = {
Expand Down