Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/viewers/board/painter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ abstract class BoardItemPainter extends ItemPainter {
get filter_net(): number | null {
return (this.view_painter as BoardPainter).filter_net;
}

protected isFillValid(fill: string ): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier doesn't like the space after string

return Boolean(fill && fill !== "none" && fill !== "no");
}
}

class LinePainter extends BoardItemPainter {
Expand Down Expand Up @@ -77,7 +81,7 @@ class RectPainter extends BoardItemPainter {

this.gfx.line(new Polyline(points, r.width, color));

if (r.fill && r.fill != "none") {
if (this.isFillValid(r.fill)) {
this.gfx.polygon(new Polygon(points, color));
}
}
Expand All @@ -104,7 +108,7 @@ class PolyPainter extends BoardItemPainter {
this.gfx.line(new Polyline([...p.pts, p.pts[0]!], p.width, color));
}

if (p.fill && p.fill != "none") {
if (this.isFillValid(p.fill)) {
this.gfx.polygon(new Polygon(p.pts, color));
}
}
Expand Down Expand Up @@ -147,7 +151,7 @@ class CirclePainter extends BoardItemPainter {
c.width,
);

if (c.fill && c.fill != "none") {
if (this.isFillValid(c.fill)) {
this.gfx.circle(
new Circle(arc.center, arc.radius + (c.width ?? 0), color),
);
Expand Down
Loading