Skip to content

Commit

Permalink
Fix web UI rendering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mbloch committed Jul 31, 2023
1 parent d8000be commit 1795ec0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/commands/mapshaper-point-to-grid.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ function getGridData(bbox, interval, opts) {
xmin + (c + 1) * interval, ymin + (r + 1) * interval
];
}

return {
size, cells, pointToCol, pointToRow, colRowToIdx, pointToIdx,
idxToCol, idxToRow, idxToBBox, idxToPoint
Expand Down
6 changes: 6 additions & 0 deletions src/gui/gui-canvas.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function drawStyledLayerToCanvas(obj, canv, ext) {
canv.drawVertices(layer.shapes, arcs, style, filter);
}
}
canv.clearStyles();
}


Expand Down Expand Up @@ -120,6 +121,11 @@ export function DisplayCanvas() {
_pixelColor = getPixelColorFunction(),
_ext;

_self.clearStyles = function() {
_ctx.fillStyle = null;
_ctx.strokeStyle = null;
};

_self.prep = function(extent) {
var w = extent.width(),
h = extent.height(),
Expand Down
2 changes: 1 addition & 1 deletion src/gui/gui-import-control.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export function ImportControl(gui, opts) {
var names = getFileNames(files);
var expanded = [];
if (files.length === 0) return;
useQuickView = importCount === 0 && (opts.quick_view || overQuickView);
useQuickView = importTotal === 0 && (opts.quick_view || overQuickView);
try {
expanded = await expandFiles(files);
} catch(e) {
Expand Down
1 change: 1 addition & 0 deletions src/io/mapshaper-json-import.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ function selectFromObject(o, path) {
var separator = path.indexOf('/') > 0 ? '/' : '.';
var parts = path.split(separator);
var subpath, array, match;

while (parts.length > 0) {
subpath = parts.shift();
match = arrayRxp.exec(subpath);
Expand Down

0 comments on commit 1795ec0

Please sign in to comment.