Skip to content

Commit

Permalink
wxGUI/digitizer: don't attempt to draw zero-length lines (OSGeo#1989)
Browse files Browse the repository at this point in the history
Fixes bug OSGeo#488.
  • Loading branch information
petrasovaa authored and ninsbl committed Feb 17, 2023
1 parent b30f502 commit 1bb8536
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gui/wxpython/vdigit/wxdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1bb8536

Please sign in to comment.