Skip to content

Commit

Permalink
Merge pull request #857 from girder/better-handle-polygon-holes
Browse files Browse the repository at this point in the history
Better handle editing polygons with holes.
  • Loading branch information
manthey authored May 16, 2022
2 parents dd5fa7d + edccada commit 5d1430e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion girder/girder_large_image/web_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"copy-webpack-plugin": "^4.5.2",
"d3": "^3.5.16",
"geojs": "^1.8.0",
"geojs": "^1.8.6",
"hammerjs": "^2.0.8",
"js-yaml": "^3.14.0",
"sinon": "^2.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import array from '../coordinates/array';
*/
function polygon(annotation) {
const element = common(annotation, 'polyline');
const coordinates = array(annotation.coordinates());
let coordinates = annotation.coordinates();
const holes = coordinates.inner ? coordinates.inner.map((h) => array(h)) : undefined;
coordinates = array(coordinates.outer || coordinates);

return _.extend(element, {
type: 'polyline',
closed: true,
points: coordinates
points: coordinates,
holes
});
}

Expand Down

0 comments on commit 5d1430e

Please sign in to comment.