def box_deselect_colliding(self):
        """Remove objs colliding w/box from selection."""
        ### get objects colliding with box selection
        colliding_objs = self.get_box_colliding()

        ### if there are no colliding objects, there's
        ### no point in keep going, so return early
        if not colliding_objs:
            return

        ### otherwise removing colliding object from
        ### selection and set the active obj

        ## get the difference between the selected objects
        ## and the colliding ones
        difference = set(self.selected_objs) - colliding_objs

        ## select objects in the difference

        self.selected_objs.clear()
        self.selected_objs.extend(difference)

        ### assign a random object among the selected ones
        ### as the active object or use None, depending
        ### on whether there are selected objects or not

        self.active_obj = (
            sample(list(self.selected_objs), 1).pop() if self.selected_objs else None
        )
Remove objs colliding w/box from selection.
nodezator/editing/selection.py