Skip to content

Commit

Permalink
v0.6.84
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Apr 4, 2024
1 parent 84f2f8d commit 8a092af
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.6.84
* Catch a polygon drawing error.

v0.6.83
* Added basemap buttons to the map.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mapshaper",
"version": "0.6.83",
"version": "0.6.84",
"description": "A tool for editing vector datasets for mapping and GIS.",
"keywords": [
"shapefile",
Expand Down
11 changes: 8 additions & 3 deletions src/gui/gui-draw-lines2.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { error, internal, geom, utils, mapshaper } from './gui-core';
import { stop, error, internal, geom, utils, mapshaper } from './gui-core';
import {
updateVertexCoords,
insertVertex,
Expand Down Expand Up @@ -490,11 +490,16 @@ export function initLineEditing(gui, ext, hit) {
// finish the path if a vertex is selected (but not an interpolated point)
var finish = hoverVertexInfo?.type == 'vertex';
if (getLastArcLength(target) < 2) {
error('Defective path');
stop('Defective path');
}
if (finish && polygonMode()) {
shapes1 = target.shapes.slice(initialShapeCount);
shapes2 = convertClosedPaths(shapes1);
try {
shapes2 = convertClosedPaths(shapes1);
} catch(e) {
console.error(e);
stop('Invalid path');
}
}
if (shapes2) {
replaceDrawnShapes(shapes2);
Expand Down

0 comments on commit 8a092af

Please sign in to comment.