From a52511a17f6683917ae602a91922753d14451b07 Mon Sep 17 00:00:00 2001 From: Anna Petrasova Date: Sun, 28 Nov 2021 22:12:26 -0500 Subject: [PATCH] wxGUI/digitizer: don't attempt to draw zero-length lines (#1989) Fixes bug #488. --- gui/wxpython/vdigit/wxdisplay.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gui/wxpython/vdigit/wxdisplay.py b/gui/wxpython/vdigit/wxdisplay.py index 434083b2184..d61158bd657 100644 --- a/gui/wxpython/vdigit/wxdisplay.py +++ b/gui/wxpython/vdigit/wxdisplay.py @@ -362,7 +362,14 @@ def _drawObject(self, robj): for i in range(robj.npoints): p = robj.point[i] points.append(wx.Point(p.x, p.y)) - + if len(points) <= 1: + self.log.write( + _( + "WARNING: Zero-length line or boundary drawing skipped. " + "Use v.clean to remove it." + ) + ) + return if robj.type == TYPE_AREA: pdc.DrawPolygon(points) else: