Esempio n. 1
0
    def get_bounds(self, include_connections=True):
        bounds = [
            visual.get_bounds(self.__application.ruler)
            for visual in self.__selected
        ]

        if include_connections and self.is_element_selected:
            for connection in self.__diagram.connections:
                if connection.source in self.__selected and connection.destination in self.__selected:
                    bounds.append(
                        connection.get_bounds(self.__application.ruler))

        return Rectangle.combine_bounds(bounds)
Esempio n. 2
0
 def get_bounds(self, ruler):
     return Rectangle.combine_bounds(
         visual.get_bounds(ruler)
         for visual in chain(self.__elements, self.__connections))