mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 16:48:11 +08:00
Automatically place layers into the artboard they're drawn inside of (#2110)
* place new layer from basic tools within an artboard bounds Signed-off-by: James Ryans <james.ryans2012@gmail.com> * add for Text Tool Signed-off-by: James Ryans <james.ryans2012@gmail.com> * use click_xray function Signed-off-by: James Ryans <james.ryans2012@gmail.com> * support for freehand tool Signed-off-by: James Ryans <james.ryans2012@gmail.com> * support spline tool Signed-off-by: James Ryans <james.ryans2012@gmail.com> --------- Signed-off-by: James Ryans <james.ryans2012@gmail.com>
This commit is contained in:
@@ -1652,6 +1652,14 @@ impl DocumentMessageHandler {
|
||||
}
|
||||
}
|
||||
|
||||
/// Finds the artboard that bounds the point in viewport space and be the container of any newly added layers.
|
||||
pub fn new_layer_bounding_artboard(&self, ipp: &InputPreprocessorMessageHandler) -> LayerNodeIdentifier {
|
||||
self.click_xray(ipp)
|
||||
.filter(|layer| self.network_interface.is_artboard(&layer.to_node(), &[]))
|
||||
.next()
|
||||
.unwrap_or(LayerNodeIdentifier::ROOT_PARENT)
|
||||
}
|
||||
|
||||
/// Finds the parent folder which, based on the current selections, should be the container of any newly added layers.
|
||||
pub fn new_layer_parent(&self, include_self: bool) -> LayerNodeIdentifier {
|
||||
self.network_interface
|
||||
|
||||
Reference in New Issue
Block a user