diff --git a/plugins/PaintTool/PaintClearCommand.py b/plugins/PaintTool/PaintClearCommand.py index 1fb5ce4467..1be8b9bcbf 100644 --- a/plugins/PaintTool/PaintClearCommand.py +++ b/plugins/PaintTool/PaintClearCommand.py @@ -42,6 +42,6 @@ class PaintClearCommand(PaintCommand): # There is actually nothing more to do here, both clear commands already have the same original texture return True - def _clearTextureBits(self, painter: QPainter): + def _clearTextureBits(self, painter: QPainter, extended = False): painter.setCompositionMode(QPainter.CompositionMode.RasterOp_NotSourceAndDestination) painter.fillRect(self._texture.getImage().rect(), QBrush(self._getBitRangeMask())) \ No newline at end of file diff --git a/plugins/PaintTool/PaintCommand.py b/plugins/PaintTool/PaintCommand.py index c4596405cc..5367d0e0ca 100644 --- a/plugins/PaintTool/PaintCommand.py +++ b/plugins/PaintTool/PaintCommand.py @@ -43,7 +43,7 @@ class PaintCommand(QUndoCommand): if self._original_texture_image is None: return - painter = self._makeClearedTexture() + painter = self._makeClearedTexture(extended=True) painter.setCompositionMode(QPainter.CompositionMode.RasterOp_SourceOrDestination) painter.drawImage(0, 0, self._original_texture_image) painter.end() @@ -55,14 +55,14 @@ class PaintCommand(QUndoCommand): if self._sliceable_object_decorator is not None: self._sliceable_object_decorator.setPaintedExtrudersCountDirty() - def _makeClearedTexture(self) -> QPainter: + def _makeClearedTexture(self, extended = False) -> QPainter: painter = QPainter(self._texture.getImage()) painter.setRenderHint(QPainter.RenderHint.Antialiasing, False) - self._clearTextureBits(painter) + self._clearTextureBits(painter, extended) return painter - def _clearTextureBits(self, painter: QPainter): + def _clearTextureBits(self, painter: QPainter, extended = False): raise NotImplementedError() @staticmethod diff --git a/plugins/PaintTool/PaintStrokeCommand.py b/plugins/PaintTool/PaintStrokeCommand.py index ec61864838..bcb38a19bc 100644 --- a/plugins/PaintTool/PaintStrokeCommand.py +++ b/plugins/PaintTool/PaintStrokeCommand.py @@ -17,6 +17,7 @@ class PaintStrokeCommand(PaintCommand): """Provides the command that does the actual painting on objects with undo/redo mechanisms""" PEN_OVERLAP_WIDTH = 2.5 + PEN_OVERLAP_WIDTH_EXTENDED = PEN_OVERLAP_WIDTH + 0.5 def __init__(self, texture: Texture, @@ -58,9 +59,9 @@ class PaintStrokeCommand(PaintCommand): return True - def _clearTextureBits(self, painter: QPainter): + def _clearTextureBits(self, painter: QPainter, extended = False): painter.setBrush(QBrush(self._getBitRangeMask())) - painter.setPen(QPen(painter.brush(), self.PEN_OVERLAP_WIDTH)) + painter.setPen(QPen(painter.brush(), self.PEN_OVERLAP_WIDTH_EXTENDED if extended else self.PEN_OVERLAP_WIDTH)) painter.setCompositionMode(QPainter.CompositionMode.RasterOp_NotSourceAndDestination) painter.drawPath(self._makePainterPath())