@@ -926,6 +926,7 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
926
926
let viewport_center_in_doc_space = transform. inverse ( ) . transform_point2 ( viewport_center) ;
927
927
928
928
let mut positions = Vec :: new ( ) ;
929
+ let mut artboards = Vec :: new ( ) ; // Track artboards separately
929
930
930
931
for & layer in & layers {
931
932
if document. network_interface . is_artboard ( & layer. to_node ( ) , & [ ] ) {
@@ -938,8 +939,20 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
938
939
}
939
940
940
941
positions. push ( ( layer, bounds[ 0 ] , true ) ) ;
942
+ artboards. push ( layer) ; // Add to artboards list
941
943
}
942
944
} else {
945
+ // Skip layers that are children of artboards we're already moving
946
+ let is_child_of_moving_artboard = artboards. iter ( ) . any ( |& artboard| {
947
+ layer. ancestors ( document. metadata ( ) )
948
+ . skip ( 1 ) // Skip self
949
+ . any ( |ancestor| ancestor == artboard)
950
+ } ) ;
951
+
952
+ if is_child_of_moving_artboard {
953
+ continue ; // Skip this layer as its parent artboard will be moved
954
+ }
955
+
943
956
if let Some ( mut modify_inputs) = ModifyInputsContext :: new_with_layer ( layer, & mut document. network_interface , responses) {
944
957
if let Some ( transform_node_id) = modify_inputs. existing_node_id ( "Transform" , true ) {
945
958
if let Some ( network) = modify_inputs. network_interface . network ( & [ ] ) {
@@ -994,7 +1007,6 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
994
1007
}
995
1008
}
996
1009
}
997
-
998
1010
PortfolioMessage :: PasteImage {
999
1011
name,
1000
1012
image,
0 commit comments