1
0
Fork 0
forked from wry/wry

tree: implement tile dragging

This commit is contained in:
Julian Orth 2024-09-30 18:31:19 +02:00
parent 83fd9f211e
commit 132986df2a
17 changed files with 925 additions and 52 deletions

View file

@ -9,7 +9,7 @@ use {
state::State,
tree::{
walker::NodeVisitor, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
OutputNode, StackedNode,
OutputNode, StackedNode, TileDragDestination,
},
utils::{copyhashmap::CopyHashMap, linkedlist::LinkedList},
},
@ -83,6 +83,21 @@ impl DisplayNode {
state.damage(self.extents.get());
}
}
pub fn tile_drag_destination(
&self,
source: NodeId,
x: i32,
y: i32,
) -> Option<TileDragDestination> {
for output in self.outputs.lock().values() {
let pos = output.node_absolute_position();
if pos.contains(x, y) {
return output.tile_drag_destination(source, x, y);
}
}
None
}
}
impl Node for DisplayNode {