@@ -934,6 +934,7 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
934
934
let viewport_center_in_doc_space = transform. inverse ( ) . transform_point2 ( viewport_center) ;
935
935
936
936
let mut positions = Vec :: new ( ) ;
937
+ let mut artboards = Vec :: new ( ) ; // Track artboards separately
937
938
938
939
for & layer in & layers {
939
940
if document. network_interface . is_artboard ( & layer. to_node ( ) , & [ ] ) {
@@ -946,8 +947,20 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
946
947
}
947
948
948
949
positions. push ( ( layer, bounds[ 0 ] , true ) ) ;
950
+ artboards. push ( layer) ; // Add to artboards list
949
951
}
950
952
} else {
953
+ // Skip layers that are children of artboards we're already moving
954
+ let is_child_of_moving_artboard = artboards. iter ( ) . any ( |& artboard| {
955
+ layer. ancestors ( document. metadata ( ) )
956
+ . skip ( 1 ) // Skip self
957
+ . any ( |ancestor| ancestor == artboard)
958
+ } ) ;
959
+
960
+ if is_child_of_moving_artboard {
961
+ continue ; // Skip this layer as its parent artboard will be moved
962
+ }
963
+
951
964
if let Some ( mut modify_inputs) = ModifyInputsContext :: new_with_layer ( layer, & mut document. network_interface , responses) {
952
965
if let Some ( transform_node_id) = modify_inputs. existing_node_id ( "Transform" , true ) {
953
966
if let Some ( network) = modify_inputs. network_interface . network ( & [ ] ) {
@@ -1002,7 +1015,6 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
1002
1015
}
1003
1016
}
1004
1017
}
1005
-
1006
1018
PortfolioMessage :: PasteImage {
1007
1019
name,
1008
1020
image,
0 commit comments