Skip to content

Commit

Permalink
tool draw line: connect to junctions in non-arb restrict mode
Browse files Browse the repository at this point in the history
changelog: Enhancements/Editors: draw line tool: connect to junctions in non-arbitrary restrict modes
  • Loading branch information
carrotIndustries committed Apr 27, 2024
1 parent 1103008 commit d0da4e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/tools/tool_draw_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ ToolResponse ToolDrawLine::update(const ToolArgs &args)
else if (args.type == ToolEventType::ACTION) {
switch (args.action) {
case InToolActionID::LMB:
if (args.target.type == ObjectType::JUNCTION && restrict_mode == RestrictMode::ARB) {
if (args.target.type == ObjectType::JUNCTION
&& (temp_line == nullptr
|| get_coord_restrict(temp_line->from->position, args.coords) == args.coords)) {
if (temp_line != nullptr) {
temp_line->to = doc.r->get_junction(args.target.path.at(0));
}
Expand Down

0 comments on commit d0da4e8

Please sign in to comment.