diff --git a/crates/fj-core/src/operations/presentation.rs b/crates/fj-core/src/operations/presentation.rs index b2e9c9211b..e583235313 100644 --- a/crates/fj-core/src/operations/presentation.rs +++ b/crates/fj-core/src/operations/presentation.rs @@ -2,16 +2,19 @@ use fj_interop::Color; -use crate::objects::Region; +use crate::{ + objects::{IsObject, Region}, + storage::Handle, +}; /// Set the color of an object -pub trait SetColor { +pub trait SetColor: IsObject { /// Set the color of the object - fn set_color(&self, color: impl Into) -> Self; + fn set_color(&self, color: impl Into) -> Self::BareObject; } -impl SetColor for Region { - fn set_color(&self, color: impl Into) -> Self { +impl SetColor for Handle { + fn set_color(&self, color: impl Into) -> Self::BareObject { Region::new( self.exterior().clone(), self.interiors().into_iter().cloned(), diff --git a/crates/fj-core/src/operations/split/face.rs b/crates/fj-core/src/operations/split/face.rs index 07683674ca..ebbc508511 100644 --- a/crates/fj-core/src/operations/split/face.rs +++ b/crates/fj-core/src/operations/split/face.rs @@ -132,18 +132,20 @@ impl SplitFace for Shell { services, ) .update_region(|region| { - let mut region = region.update_exterior(|cycle| { - cycle - .add_half_edges(half_edges_b_to_c_inclusive) - .add_half_edges([dividing_half_edge_c_to_b]) - .insert(services) - }); + let mut region = region + .update_exterior(|cycle| { + cycle + .add_half_edges(half_edges_b_to_c_inclusive) + .add_half_edges([dividing_half_edge_c_to_b]) + .insert(services) + }) + .insert(services); if let Some(color) = face.region().color() { - region = region.set_color(color); + region = region.set_color(color).insert(services); } - region.insert(services) + region }) .insert(services); @@ -157,18 +159,20 @@ impl SplitFace for Shell { services, ) .update_region(|region| { - let mut region = region.update_exterior(|cycle| { - cycle - .add_half_edges(half_edges_d_to_a_inclusive) - .add_half_edges([dividing_half_edge_a_to_d]) - .insert(services) - }); + let mut region = region + .update_exterior(|cycle| { + cycle + .add_half_edges(half_edges_d_to_a_inclusive) + .add_half_edges([dividing_half_edge_a_to_d]) + .insert(services) + }) + .insert(services); if let Some(color) = face.region().color() { - region = region.set_color(color); + region = region.set_color(color).insert(services); } - region.insert(services) + region }) .insert(services);