Skip to content

Commit

Permalink
Fix a crash when adding a symmetric constraint on a line.
Browse files Browse the repository at this point in the history
This is the same problem as in a2c97fc.
  • Loading branch information
whitequark committed Nov 16, 2016
1 parent 74d8621 commit 82746b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,13 @@ void Constraint::MenuConstrain(int id) {
((gs.workplanes == 1 && gs.n == 2) ||
(gs.n == 1)))
{
int i = SK.GetEntity(gs.entity[0])->IsWorkplane() ? 1 : 0;
Entity *line = SK.GetEntity(gs.entity[i]);
c.entityA = gs.entity[1-i];
Entity *line;
if(SK.GetEntity(gs.entity[0])->IsWorkplane()) {
line = SK.GetEntity(gs.entity[1]);
c.entityA = gs.entity[0];
} else {
line = SK.GetEntity(gs.entity[0]);
}
c.ptA = line->point[0];
c.ptB = line->point[1];
} else if(SS.GW.LockedInWorkplane()
Expand Down

0 comments on commit 82746b6

Please sign in to comment.