Skip to content

Commit

Permalink
Fixed #80: AttributeError when saving plot to PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 4, 2023
1 parent 228bc77 commit 8043ad6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# PythonQwt Releases

## Version 0.10.4

- [Issue #80](https://github.com/PlotPyStack/PythonQwt/issues/80) - Print to PDF: AttributeError: 'NoneType' object has no attribute 'getContentsMargins'

## Version 0.10.3

- [Issue #79](https://github.com/PlotPyStack/PythonQwt/issues/79) - TypeError: unexpected type 'QSize' (thanks to @luc-j-bourhis)
Expand Down
2 changes: 1 addition & 1 deletion qwt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
.. _GitHub: https://github.com/PlotPyStack/PythonQwt
"""

__version__ = "0.10.3"
__version__ = "0.10.4"
QWT_VERSION_STR = "6.1.5"

import warnings
Expand Down
2 changes: 1 addition & 1 deletion qwt/plot_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def render(self, plot, painter, plotRect):
invtrans, _ok = transform.inverted()
layoutRect = invtrans.mapRect(plotRect)
if not (self.__data.discardFlags & self.DiscardBackground):
left, top, right, bottom = plot.layout().getContentsMargins()
left, top, right, bottom = plot.getContentsMargins()
layoutRect.adjust(left, top, -right, -bottom)

layout = plot.plotLayout()
Expand Down

0 comments on commit 8043ad6

Please sign in to comment.