Skip to content

Commit

Permalink
fix: pass correct state and layout for container widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Apr 1, 2024
1 parent 015a325 commit 5b9f77b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 5 additions & 9 deletions widget/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,11 @@ where
layout: Layout<'_>,
dnd_rectangles: &mut iced_style::core::clipboard::DndDestinationRectangles,
) {
if let Some((layout, state)) =
layout.children().zip(state.children.iter()).next()
{
self.content.as_widget().drag_destinations(
state,
layout,
dnd_rectangles,
);
}
self.content.as_widget().drag_destinations(
state,
layout,
dnd_rectangles,
);
}
}

Expand Down
4 changes: 1 addition & 3 deletions widget/src/mouse_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,7 @@ where
layout: Layout<'_>,
dnd_rectangles: &mut iced_style::core::clipboard::DndDestinationRectangles,
) {
if let Some((layout, state)) =
layout.children().zip(state.children.iter()).next()
{
if let Some(state) = state.children.iter().next() {
self.content.as_widget().drag_destinations(
state,
layout,
Expand Down

0 comments on commit 5b9f77b

Please sign in to comment.