From 249046614c604df488e547369c096f9689e9287a Mon Sep 17 00:00:00 2001 From: J Guthrie Date: Sun, 24 Feb 2019 13:58:16 +0000 Subject: [PATCH] Add exception to isInvalidGeometry algorithm - An area with just 1 placed node (2 nodes including active, to-be-placed node, returns as valid and is picked up by later way.isDegenerate() check --- modules/behavior/draw_way.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/behavior/draw_way.js b/modules/behavior/draw_way.js index aed7a8042..0f3d2435d 100644 --- a/modules/behavior/draw_way.js +++ b/modules/behavior/draw_way.js @@ -125,6 +125,8 @@ export function behaviorDrawWay(context, wayID, index, mode, startGraph, baselin if (origWay.isClosed()) { // Check if Area if (finishDraw) { + if (nodes.length < 3) return false; + nodes.splice(-2, 1); entity = nodes[nodes.length-2]; } else {