From b1b2f4662b611321b3f07b3d2d1a5b032a6d4274 Mon Sep 17 00:00:00 2001 From: boylea Date: Tue, 19 Nov 2019 20:03:15 -0800 Subject: [PATCH] Fixed image scatter plot export bug (#88) --- pyqtgraph/graphicsItems/GraphicsItem.py | 5 +++-- pyqtgraph/graphicsItems/ScatterPlotItem.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyqtgraph/graphicsItems/GraphicsItem.py b/pyqtgraph/graphicsItems/GraphicsItem.py index 628b495b..439d94ad 100644 --- a/pyqtgraph/graphicsItems/GraphicsItem.py +++ b/pyqtgraph/graphicsItems/GraphicsItem.py @@ -98,8 +98,9 @@ class GraphicsItem(object): Extends deviceTransform to automatically determine the viewportTransform. """ if self._exportOpts is not False and 'painter' in self._exportOpts: ## currently exporting; device transform may be different. - return self._exportOpts['painter'].deviceTransform() * self.sceneTransform() - + scaler = self._exportOpts['resolutionScale'] + return self.sceneTransform() * QtGui.QTransform(scaler, 0, 0, scaler, 1, 1) + if viewportTransform is None: view = self.getViewWidget() if view is None: diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index 67fafd83..bfc41969 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -781,7 +781,7 @@ class ScatterPlotItem(GraphicsObject): pts = pts[:,viewMask] for i, rec in enumerate(data): p.resetTransform() - p.translate(pts[0,i] + rec['width'], pts[1,i] + rec['width']) + p.translate(pts[0,i] + rec['width'], pts[1,i] + rec['width']/2) drawSymbol(p, *self.getSpotOpts(rec, scale)) else: if self.picture is None: