1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Add UiBuilder::layer_id, and remove layer_id from Ui::new (#5195)

This adds `UiBuilder::layer_id` to replace `ui.with_layer_id`
This commit is contained in:
Emil Ernerfeldt
2024-10-01 10:39:44 +02:00
committed by GitHub
parent fe368bacc4
commit 5f8f149444
7 changed files with 46 additions and 20 deletions

View File

@@ -433,7 +433,7 @@ fn drag_source<R>(
// Paint the body to a new layer:
let layer_id = egui::LayerId::new(egui::Order::Tooltip, id);
let res = ui.with_layer_id(layer_id, body);
let res = ui.scope_builder(UiBuilder::new().layer_id(layer_id), body);
if let Some(pointer_pos) = ui.ctx().pointer_interact_pos() {
let delta = pointer_pos - res.response.rect.center();