From e1ba8f9a18ba1dfb21341369ffd0f2880d380542 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 15 Dec 2017 14:28:23 +0000 Subject: [PATCH] Don't try to erase liesn with less than 2 points --- Nibriboard/ClientFiles/Chunk.js | 5 +++++ Nibriboard/lib/GlidingSquirrel | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Nibriboard/ClientFiles/Chunk.js b/Nibriboard/ClientFiles/Chunk.js index 6213b36..a38c195 100644 --- a/Nibriboard/ClientFiles/Chunk.js +++ b/Nibriboard/ClientFiles/Chunk.js @@ -79,6 +79,11 @@ class Chunk for (let i = this.lines.length - 1; i >= 0; i--) { // If our distance to the line is less than half the width (i.e. // the radius), then we must be inside it + + // Skip lines with less than 2 points + // TODO: Handle these separately + if(this.lines[i].Points.length < 2) + continue; let thisLineDistanceData = point_line_distance_multi(point, this.lines[i].Points); if(thisLineDistanceData[1] <= this.lines[i].Width / 2) return this.lines[i]; diff --git a/Nibriboard/lib/GlidingSquirrel b/Nibriboard/lib/GlidingSquirrel index f56620e..fc8f65e 160000 --- a/Nibriboard/lib/GlidingSquirrel +++ b/Nibriboard/lib/GlidingSquirrel @@ -1 +1 @@ -Subproject commit f56620e8cf1ad23a9f24aeeb0b850ef2c749b474 +Subproject commit fc8f65e2aff3953e6ca616d26df0d87ba4b4c3d3