mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Remove clip_rect_margin (#8366)
* Closes https://github.com/emilk/egui/issues/5605 It has been zero by default for a few months now, and I do not wish to support it. It was always an ugly hack, and it is no longer needed.
This commit is contained in:
@@ -451,17 +451,13 @@ fn drop_target<R>(
|
||||
) -> egui::InnerResponse<R> {
|
||||
let is_being_dragged = ui.ctx().dragged_id().is_some();
|
||||
|
||||
let margin = egui::Vec2::splat(ui.visuals().clip_rect_margin); // 3.0
|
||||
|
||||
let background_id = ui.painter().add(egui::Shape::Noop);
|
||||
|
||||
let available_rect = ui.available_rect_before_wrap();
|
||||
let inner_rect = available_rect.shrink2(margin);
|
||||
let mut content_ui = ui.new_child(UiBuilder::new().max_rect(inner_rect));
|
||||
let mut content_ui = ui.new_child(UiBuilder::new().max_rect(available_rect));
|
||||
let ret = body(&mut content_ui);
|
||||
|
||||
let outer_rect =
|
||||
egui::Rect::from_min_max(available_rect.min, content_ui.min_rect().max + margin);
|
||||
let outer_rect = egui::Rect::from_min_max(available_rect.min, content_ui.min_rect().max);
|
||||
let (rect, response) = ui.allocate_at_least(outer_rect.size(), egui::Sense::hover());
|
||||
|
||||
let style = if is_being_dragged && response.hovered() {
|
||||
|
||||
Reference in New Issue
Block a user