Skip to content

Commit 59b748f

Browse files
committed
Fix issue with oblique averaged cross section computation
1 parent 3b97598 commit 59b748f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

plotpy/panels/csection/csitem.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ def compute_oblique_section(item, obj, debug=False):
196196
"""Return oblique averaged cross section"""
197197
global TEMP_ITEM
198198

199+
if obj.plot() is None:
200+
# Item has not yet been added to the plot
201+
return np.array([]), np.array([])
202+
199203
xa, ya, xb, yb = obj.get_bounding_rect_coords()
200204
x0, y0, x1, y1, x2, y2, x3, y3 = obj.get_rect()
201205

0 commit comments

Comments
 (0)