@@ -368,24 +368,19 @@ impl Document {
368368 if let Ok ( layer) = self . layer_mut ( path) {
369369 layer. visible = !layer. visible ;
370370 }
371- let path = path. as_slice ( ) [ ..path. len ( ) - 1 ] . to_vec ( ) ;
372- Some ( vec ! [ DocumentResponse :: DocumentChanged , DocumentResponse :: FolderChanged { path } ] )
371+ Some ( vec ! [ DocumentResponse :: DocumentChanged , DocumentResponse :: LayerChanged { path: path. clone( ) } ] )
373372 }
374373 Operation :: SetLayerBlendMode { path, blend_mode } => {
375374 self . mark_as_dirty ( path) ?;
376375 self . layer_mut ( path) ?. blend_mode = * blend_mode;
377376
378- let path = path. as_slice ( ) [ ..path. len ( ) - 1 ] . to_vec ( ) ;
379-
380- Some ( vec ! [ DocumentResponse :: DocumentChanged , DocumentResponse :: FolderChanged { path } ] )
377+ Some ( vec ! [ DocumentResponse :: DocumentChanged , DocumentResponse :: LayerChanged { path: path. clone( ) } ] )
381378 }
382379 Operation :: SetLayerOpacity { path, opacity } => {
383380 self . mark_as_dirty ( path) ?;
384381 self . layer_mut ( path) ?. opacity = * opacity;
385382
386- let path = path. as_slice ( ) [ ..path. len ( ) - 1 ] . to_vec ( ) ;
387-
388- Some ( vec ! [ DocumentResponse :: DocumentChanged , DocumentResponse :: LayerChanged { path } ] )
383+ Some ( vec ! [ DocumentResponse :: DocumentChanged , DocumentResponse :: LayerChanged { path: path. clone( ) } ] )
389384 }
390385 Operation :: FillLayer { path, color } => {
391386 let layer = self . layer_mut ( path) ?;
@@ -394,7 +389,7 @@ impl Document {
394389 _ => return Err ( DocumentError :: NotAShape ) ,
395390 }
396391 self . mark_as_dirty ( path) ?;
397- Some ( vec ! [ DocumentResponse :: DocumentChanged ] )
392+ Some ( vec ! [ DocumentResponse :: DocumentChanged , DocumentResponse :: LayerChanged { path : path . clone ( ) } ] )
398393 }
399394 } ;
400395 Ok ( responses)
0 commit comments