Skip to content

Commit 6567e9a

Browse files
committed
Add fillrule param to zones
1 parent ae27915 commit 6567e9a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

DATAFORMAT.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ pcbdata = {
7373
// SVG path of the polygon given as 'd' attribute of svg spec.
7474
// If "svgpath" is present "polygons" is ignored.
7575
"svgpath": svgpath,
76+
// optional fillrule flag, defaults to nonzero
77+
"fillrule": "nonzero" | "evenodd",
7678
"polygons": [
7779
// Set of polylines same as in polygon drawing.
7880
[[point1x, point1y], [point2x, point2y], ...],

InteractiveHtmlBom/ecad/schema/genericjsonpcbdata_v1.schema

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,14 @@
568568
"polygons": {
569569
"$ref": "#/definitions/Polygons"
570570
},
571-
"net": { "type": "string" }
571+
"net": { "type": "string" },
572+
"fillrule": {
573+
"type": "string",
574+
"enum": [
575+
"nonzero",
576+
"evenodd"
577+
]
578+
}
572579
},
573580
"anyOf": [
574581
{ "required": [ "svgpath" ] },

InteractiveHtmlBom/web/render.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ function drawZones(canvas, layer, color, highlight) {
440440
zone.path2d = getPolygonsPath(zone);
441441
}
442442
if (highlight && highlightedNet != zone.net) continue;
443-
ctx.fill(zone.path2d);
443+
ctx.fill(zone.path2d, zone.fillrule || "nonzero");
444444
if (zone.width > 0) {
445445
ctx.lineWidth = zone.width;
446446
ctx.stroke(zone.path2d);

0 commit comments

Comments
 (0)