Skip to content

Commit

Permalink
tool add plane: set plane settings from rules
Browse files Browse the repository at this point in the history
fixes #600
  • Loading branch information
carrotIndustries committed May 28, 2021
1 parent 87453a9 commit 2885d96
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/tools/tool_edit_plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ ToolResponse ToolEditPlane::begin(const ToolArgs &args)
else {
auto uu = UUID::random();
plane = &brd->planes.emplace(uu, uu).first->second;
plane->settings =
dynamic_cast<const BoardRules &>(*doc.b->get_rules()).get_plane_settings(nullptr, poly->layer);
plane->polygon = poly;
poly->usage = plane;
}
Expand All @@ -85,6 +87,10 @@ ToolResponse ToolEditPlane::begin(const ToolArgs &args)
if (r) {
if (brd->planes.count(plane_uuid)) { // may have been deleted
nets.insert(plane->net->uuid);
if (tool_id == ToolID::ADD_PLANE && plane->from_rules) {
plane->settings = dynamic_cast<const BoardRules &>(*doc.b->get_rules())
.get_plane_settings(plane->net, poly->layer);
}
brd->update_plane(plane);
brd->update_airwires(false, nets);
}
Expand Down

0 comments on commit 2885d96

Please sign in to comment.