Commit 70724a44 authored by JosefNevrly's avatar JosefNevrly
Browse files

Added check for zero ViewBox width when calculating automatic downsampling...

Added check for zero ViewBox width when calculating automatic downsampling ratio. (Prevents zero-division when downsampling is set before Plot is properly created and drawn within a container).
parent c8f03e82
......@@ -532,6 +532,7 @@ class PlotDataItem(GraphicsObject):
x0 = (range.left()-x[0]) / dx
x1 = (range.right()-x[0]) / dx
width = self.getViewBox().width()
if width != 0.0:
ds = int(max(1, int(0.2 * (x1-x0) / width)))
## downsampling is expensive; delay until after clipping.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment