Skip to content

Commit 06a7592

Browse files
committed
Do not update stacks at every stroke, but under the anti-bounce timer
CURA-12752
1 parent f9c77f8 commit 06a7592

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

cura/Scene/SliceableObjectDecorator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def _onTextureChangeTimerFinished(self) -> None:
6262
texel_counts = numpy.bincount((image_array & bit_mask) >> bit_range_start)
6363
self._painted_extruders = [extruder_nr for extruder_nr, count in enumerate(texel_counts) if count > 0]
6464

65+
from cura.CuraApplication import CuraApplication
66+
CuraApplication.getInstance().globalContainerStackChanged.emit()
67+
6568
def setPaintTexture(self, texture: Texture) -> None:
6669
self._paint_texture = texture
6770
self.paintTextureChanged.emit()

plugins/PaintTool/PaintClearCommand.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def redo(self) -> None:
3535
self._setPaintedExtrudersCountDirty()
3636
self._texture.updateImagePart(self._bounding_rect)
3737

38-
self._signalUpdated()
39-
4038
def mergeWith(self, command: QUndoCommand) -> bool:
4139
if not isinstance(command, PaintClearCommand):
4240
return False

plugins/PaintTool/PaintCommand.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ def undo(self) -> None:
5151
self._setPaintedExtrudersCountDirty()
5252
self._texture.updateImagePart(self._bounding_rect)
5353

54-
self._signalUpdated()
55-
5654
def _setPaintedExtrudersCountDirty(self) -> None:
5755
if self._sliceable_object_decorator is not None:
5856
self._sliceable_object_decorator.setPaintedExtrudersCountDirty()
@@ -75,6 +73,3 @@ def getBitRangeMask(bit_range: tuple[int, int]) -> int:
7573

7674
def _getBitRangeMask(self) -> int:
7775
return PaintCommand.getBitRangeMask(self._bit_range)
78-
79-
def _signalUpdated(self):
80-
CuraApplication.getInstance().globalContainerStackChanged.emit()

plugins/PaintTool/PaintStrokeCommand.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def redo(self) -> None:
4545
self._setPaintedExtrudersCountDirty()
4646
self._texture.updateImagePart(self._bounding_rect)
4747

48-
self._signalUpdated()
49-
5048
def mergeWith(self, command: QUndoCommand) -> bool:
5149
if not isinstance(command, PaintStrokeCommand):
5250
return False

0 commit comments

Comments
 (0)