refactor(drawing/drawing): Add filtering predicate also for `.insert_cane(...)`

This commit is contained in:
Mikolaj Wielgus 2025-09-02 19:58:30 +02:00
parent 3ddf382325
commit 9f7e10bc03
2 changed files with 3 additions and 1 deletions

View File

@ -641,6 +641,7 @@ impl<CW: Clone, Cel: Copy, R: AccessRules> Drawing<CW, Cel, R> {
seg_weight: SeqLooseSegWeight, seg_weight: SeqLooseSegWeight,
bend_weight: LooseBendWeight, bend_weight: LooseBendWeight,
sense: RotationSense, sense: RotationSense,
filter: &impl Fn(&Self, PrimitiveIndex, PrimitiveIndex) -> bool,
) -> Result<Cane, DrawingException> { ) -> Result<Cane, DrawingException> {
let outer_gears = around.ref_(self).outer_gears(); let outer_gears = around.ref_(self).outer_gears();
let cane = self.add_cane( let cane = self.add_cane(
@ -651,7 +652,7 @@ impl<CW: Clone, Cel: Copy, R: AccessRules> Drawing<CW, Cel, R> {
seg_weight, seg_weight,
bend_weight, bend_weight,
sense, sense,
&|_drawing, _infringer, _infringee| true, filter,
)?; )?;
for gear in outer_gears { for gear in outer_gears {

View File

@ -114,6 +114,7 @@ impl<R: AccessRules> Layout<R> {
seg_weight, seg_weight,
bend_weight, bend_weight,
sense, sense,
&|_drawing, _infringer, _infringee| true,
) )
} }