Skip to content

Commit

Permalink
v0.6.73
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Mar 18, 2024
1 parent f32d25c commit 9286027
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.6.73
* Added drawing/reshaping to polygon layer editing menu.
* Added info box with drawing instructions.

v0.6.72
* Bug fix

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.72",
"version": "0.6.73",
"description": "A tool for editing vector datasets for mapping and GIS.",
"keywords": [
"shapefile",
Expand Down
14 changes: 8 additions & 6 deletions src/gui/gui-draw-lines2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function initLineEditing(gui, ext, hit) {
var prevMode = gui.getMode();
if (e.mode == 'drawing') {
gui.enterMode('drawing_tool');
} else if (prevMode == 'drawing') {
} else if (active()) {
gui.clearMode();
}
}, null, 10); // higher priority than hit control, so turnOff() has correct hit target
Expand Down Expand Up @@ -109,7 +109,9 @@ export function initLineEditing(gui, ext, hit) {

function turnOff() {
finishPath();
finish();
if (polygonMode()) {
finishPolygons();
}
clearDrawingInfo();
alert.close();
alert = null;
Expand All @@ -121,15 +123,15 @@ export function initLineEditing(gui, ext, hit) {
}

function finish() {
var target = hit.getHitTarget();
if (target.arcs.size() <= initialArcCount) return; // nothing was added
if (polygonMode()) {
finishPolygons(target);
finishPolygons();
}
}

function finishPolygons(target) {
function finishPolygons() {
// step1: make a polyline layer containing just newly drawn paths
var target = hit.getHitTarget();
if (target.arcs.size() <= initialArcCount) return; // no paths added
var polygonLyr = target.source.layer;
var polygonRecords = polygonLyr.data ? polygonLyr.data.getRecords() : null;
var templateRecord;
Expand Down

0 comments on commit 9286027

Please sign in to comment.