From 3c352dd1a984a14d347a0564becc24e2f1ffc1a4 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Sat, 5 Jun 2021 21:09:58 -0700 Subject: [PATCH] Fix documentation misalignment --- pyqtgraph/graphicsItems/ImageItem.py | 36 +++++++++++++--------- pyqtgraph/graphicsItems/PlotCurveItem.py | 38 ++++++++++++++++-------- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/pyqtgraph/graphicsItems/ImageItem.py b/pyqtgraph/graphicsItems/ImageItem.py index f8153755..71e1de3a 100644 --- a/pyqtgraph/graphicsItems/ImageItem.py +++ b/pyqtgraph/graphicsItems/ImageItem.py @@ -76,23 +76,31 @@ class ImageItem(GraphicsObject): def setCompositionMode(self, mode): """ - Change the composition mode of the item to `mode`, used when overlaying multiple ImageItems. - See ``QPainter::CompositionMode`` in the Qt documentation for details. - - Most common arguments: + Change the composition mode of the item. This is useful when overlaying + multiple items. - - ``QtGui.QPainter.CompositionMode_SourceOver``: - (Default) Image replaces the background if it is opaque. - Otherwise the alpha channel controls the visibility of the background. + Parameters + ---------- + mode : ``QtGui.QPainter.CompositionMode`` + Composition of the item, often used when overlaying items. Common + options include: - - ``QtGui.QPainter.CompositionMode_Overlay``: - The image color is mixed with the background color to reflect the lightness or darkness of the background. - - - ``QtGui.QPainter.CompositionMode_Plus``: - Both the alpha and color of the image and background pixels are added together. + ``QPainter.CompositionMode.CompositionMode_SourceOver`` (Default) + Image replaces the background if it is opaque. Otherwise, it uses + the alpha channel to blend the image with the background. - - ``QtGui.QPainter.CompositionMode_Multiply``: - The output is the image color multiplied by the background. + ``QPainter.CompositionMode.CompositionMode_Overlay`` Image color is + mixed with the background color to reflect the lightness or + darkness of the background + + ``QPainter.CompositionMode.CompositionMode_Plus`` Both the alpha + and color of the image and background pixels are added together. + + ``QPainter.CompositionMode.CompositionMode_Plus`` The output is the + image color multiplied by the background. + + See ``QPainter::CompositionMode`` in the Qt Documentation for more + options and details """ self.paintMode = mode self.update() diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py index a079537f..67441212 100644 --- a/pyqtgraph/graphicsItems/PlotCurveItem.py +++ b/pyqtgraph/graphicsItems/PlotCurveItem.py @@ -94,20 +94,32 @@ class PlotCurveItem(GraphicsObject): self._boundingRect = None def setCompositionMode(self, mode): - """Change the composition mode of the item (see QPainter::CompositionMode - in the Qt documentation). This is useful when overlaying multiple items. + """ + Change the composition mode of the item. This is useful when overlaying + multiple items. + + Parameters + ---------- + mode : ``QtGui.QPainter.CompositionMode`` + Composition of the item, often used when overlaying items. Common + options include: - ============================================ ============================================================ - **Most common arguments:** - QtGui.QPainter.CompositionMode.CompositionMode_SourceOver Default; image replaces the background if it - is opaque. Otherwise, it uses the alpha channel to blend - the image with the background. - QtGui.QPainter.CompositionMode.CompositionMode_Overlay The image color is mixed with the background color to - reflect the lightness or darkness of the background. - QtGui.QPainter.CompositionMode.CompositionMode_Plus Both the alpha and color of the image and background pixels - are added together. - QtGui.QPainter.CompositionMode.CompositionMode_Multiply The output is the image color multiplied by the background. - ============================================ ============================================================ + ``QPainter.CompositionMode.CompositionMode_SourceOver`` (Default) + Image replaces the background if it is opaque. Otherwise, it uses + the alpha channel to blend the image with the background. + + ``QPainter.CompositionMode.CompositionMode_Overlay`` Image color is + mixed with the background color to reflect the lightness or + darkness of the background + + ``QPainter.CompositionMode.CompositionMode_Plus`` Both the alpha + and color of the image and background pixels are added together. + + ``QPainter.CompositionMode.CompositionMode_Plus`` The output is the + image color multiplied by the background. + + See ``QPainter::CompositionMode`` in the Qt Documentation for more + options and details """ self.opts['compositionMode'] = mode self.update()