From 455c26d37e08eb52f1ecfaeefce9f24cc656e88f Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Sun, 29 Sep 2024 01:45:48 +0200 Subject: [PATCH] egui_webview: fix browser position --- crates/egui_dnd/src/item.rs | 1 + crates/egui_webview/src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/egui_dnd/src/item.rs b/crates/egui_dnd/src/item.rs index 588281b..75e2c41 100644 --- a/crates/egui_dnd/src/item.rs +++ b/crates/egui_dnd/src/item.rs @@ -266,6 +266,7 @@ impl<'a> Item<'a> { .interactable(false) .fixed_pos(pos) .order(Order::Tooltip) + .constrain(false) .show(ui.ctx(), |ui| { ui.with_layout(layout, |ui| { if let Some(size) = size.or(dnd_state.detection_state.dragged_item_size()) { diff --git a/crates/egui_webview/src/lib.rs b/crates/egui_webview/src/lib.rs index ad9ab97..e6e08c2 100644 --- a/crates/egui_webview/src/lib.rs +++ b/crates/egui_webview/src/lib.rs @@ -266,13 +266,15 @@ impl EguiWebView { }); } + let screen_rect = ui.ctx().screen_rect(); + let wv_height = screen_rect.height() * ui.ctx().zoom_factor(); let wv_rect = response.rect * ui.ctx().zoom_factor(); self.view .set_bounds(wry::Rect { position: Position::Logical(LogicalPosition::new( f64::from(wv_rect.min.x), - f64::from(wv_rect.min.y), + f64::from(wv_height - wv_rect.max.y), )), size: Size::Logical(LogicalSize::new( f64::from(wv_rect.width()),