Use boundingBoxChanged signal to recompute convex hull

The boundingbox is the signal we should be listening for, since it does the same as the
previous ones (and more!). This also fixes the issue that group nodes didn't get their
convex hull set correctly on first creation

CURA-6416
This commit is contained in:
Jaime van Kessel 2019-04-08 09:40:38 +02:00
parent fe14024620
commit 8fb3a73c3a

View file

@ -60,13 +60,11 @@ class ConvexHullDecorator(SceneNodeDecorator):
previous_node = self._node
# Disconnect from previous node signals
if previous_node is not None and node is not previous_node:
previous_node.transformationChanged.disconnect(self._onChanged)
previous_node.parentChanged.disconnect(self._onChanged)
previous_node.boundingBoxChanged.disconnect(self._onChanged)
super().setNode(node)
# Mypy doesn't understand that self._node is no longer optional, so just use the node.
node.transformationChanged.connect(self._onChanged)
node.parentChanged.connect(self._onChanged)
node.boundingBoxChanged.connect(self._onChanged)
self._onChanged()