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).
This commit is contained in:
parent
c8f03e828e
commit
70724a44b3
@ -532,7 +532,8 @@ class PlotDataItem(GraphicsObject):
|
|||||||
x0 = (range.left()-x[0]) / dx
|
x0 = (range.left()-x[0]) / dx
|
||||||
x1 = (range.right()-x[0]) / dx
|
x1 = (range.right()-x[0]) / dx
|
||||||
width = self.getViewBox().width()
|
width = self.getViewBox().width()
|
||||||
ds = int(max(1, int(0.2 * (x1-x0) / width)))
|
if width != 0.0:
|
||||||
|
ds = int(max(1, int(0.2 * (x1-x0) / width)))
|
||||||
## downsampling is expensive; delay until after clipping.
|
## downsampling is expensive; delay until after clipping.
|
||||||
|
|
||||||
if self.opts['clipToView']:
|
if self.opts['clipToView']:
|
||||||
|
Loading…
Reference in New Issue
Block a user