Don't move points when automatically constraining coincident.

This can change the sketch dramatically, e.g. extrude a rectangle
and draw a line diagonally from the top to the bottom face.
pull/106/head
EvilSpirit 2017-01-09 23:57:45 +07:00 committed by whitequark
parent 855de072be
commit c00ab25740
1 changed files with 9 additions and 1 deletions

View File

@ -885,6 +885,8 @@ bool GraphicsWindow::ConstrainPointByHovered(hEntity pt) {
Entity *e = SK.GetEntity(hover.entity);
if(e->IsPoint()) {
Entity *point = SK.GetEntity(pt);
point->PointForceTo(e->PointGetNum());
Constraint::ConstrainCoincident(e->h, pt);
return true;
}
@ -988,7 +990,13 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
Entity::NO_ENTITY, Entity::NO_ENTITY,
lns[i].entity(0));
}
ConstrainPointByHovered(lns[2].entity(1));
if(ConstrainPointByHovered(lns[2].entity(1))) {
Vector pos = SK.GetEntity(lns[2].entity(1))->PointGetNum();
for(i = 0; i < 4; i++) {
SK.GetEntity(lns[i].entity(1))->PointForceTo(pos);
SK.GetEntity(lns[i].entity(2))->PointForceTo(pos);
}
}
pending.operation = Pending::DRAGGING_NEW_POINT;
pending.point = lns[1].entity(2);