pub fn add(&mut self, rect: &Box2D<f32>, is_opaque: bool, key: u64) -> bool {
        let mut fragments: SmallVec<[Box2D<f32>; 16]> = SmallVec::new();
        fragments.push(*rect);

        for item in &self.opaque_items {
            if fragments.is_empty() {
                break;
            }
            if item.rectangle.intersects(rect) {
                apply_occluder(&item.rectangle, &mut fragments);
            }
        }

        let list = if is_opaque {
            &mut self.opaque_items
        } else {
            &mut self.alpha_items
        };

        for rect in &fragments {
            list.push(Item {
                rectangle: *rect,
                key,
            });
        }

        !fragments.is_empty()
    }
/// Add a rectangle, potentially splitting it and discarding the occluded parts if any.
///
/// Returns true the rectangle is at least partially visible.
Add a rectangle, potentially splitting it and discarding the occluded parts if any.
Returns true the rectangle is at least partially visible.
Add a rectangle potentially splitting it and discarding the occluded parts if any . Returns true the rectangle is at least partially visible .
pub fn add(&mut self, rect: &Box2D<f32>, is_opaque: bool, key: u64) -> bool {
        let mut fragments: SmallVec<[Box2D<f32>; 16]> = SmallVec::new();
        fragments.push(*rect);
        for item in &self.opaque_items {
            if fragments.is_empty() {
                break;
            }
            if item.rectangle.intersects(rect) {
                apply_occluder(&item.rectangle, &mut fragments);
            }
        }
        let list = if is_opaque {
            &mut self.opaque_items
        } else {
            &mut self.alpha_items
        };
        for rect in &fragments {
            list.push(Item {
                rectangle: *rect,
                key,
            });
        }
        !fragments.is_empty()
    }
pub fn add ( & mut self , rect : & Box2D < f32 > , is_opaque : bool , key : u64 ) -> bool { let mut fragments : SmallVec < [ Box2D < f32 > ; 16 ] > = SmallVec :: new ( ) ; fragments . push ( * rect ) ; for item in & self . opaque_items { if fragments . is_empty ( ) { break ; } if item . rectangle . intersects ( rect ) { apply_occluder ( & item . rectangle , & mut fragments ) ; } } let list = if is_opaque { & mut self . opaque_items } else { & mut self . alpha_items } ; for rect in & fragments { list . push ( Item { rectangle : * rect , key , } ) ; } ! fragments . is_empty ( ) }
Add a rectangle, potentially splitting it and discarding the occluded parts if any.
Add a rectangle potentially splitting it and discarding the occluded parts if any .
&mut self
rect
&Box2D<f32>
is_opaque
bool
key
u64