Skip to content

Commit

Permalink
move tool: move junctions connected power symbols
Browse files Browse the repository at this point in the history
similar to symbols
  • Loading branch information
carrotIndustries committed Mar 19, 2022
1 parent 11bce73 commit 670d962
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/core/tools/tool_move.cpp
Expand Up @@ -79,6 +79,25 @@ void ToolMove::expand_selection()
case ObjectType::POWER_SYMBOL: {
auto &ps = doc.c->get_sheet()->power_symbols.at(it.uuid);
new_sel.emplace(ps.junction->uuid, ObjectType::JUNCTION);
for (const auto &uu_line : ps.junction->connected_net_lines) {
const auto &line = doc.c->get_sheet()->net_lines.at(uu_line);
for (const auto &it_ft : {line.from, line.to}) {
if (it_ft.is_junc()) {
const auto &ju = *it_ft.junc;
const auto pin_pos = ps.junction->position;
Axis ax = Axis::NONE;
if (pin_pos.x == ju.position.x)
ax = Axis::X;
else if (pin_pos.y == ju.position.y)
ax = Axis::Y;

if (ju.connected_net_lines.size() == 1) { // dangling end
ax = Axis::X | Axis::Y;
}
add_extra_junction(ju.uuid, ax);
}
}
}
} break;
case ObjectType::BUS_RIPPER: {
auto &rip = doc.c->get_sheet()->bus_rippers.at(it.uuid);
Expand Down

0 comments on commit 670d962

Please sign in to comment.