Multiply constraint values by scale when pasting with transformation.

This commit is contained in:
whitequark 2016-07-19 12:12:01 +00:00
parent 61904280a3
commit 5af252eaf1
2 changed files with 17 additions and 1 deletions

View File

@ -15,6 +15,7 @@ Bug fixes:
* Three.js: correctly respond to controls when browser zoom is used.
* OS X: do not completely hide main window when defocused.
* GTK: unbreak 3Dconnexion support.
* When pasting transformed entities, multiply constraint values by scale.
2.1
---

View File

@ -212,9 +212,24 @@ void GraphicsWindow::PasteClipboard(Vector trans, double theta, double scale) {
c.reference = cc->reference;
c.disp = cc->disp;
c.comment = cc->comment;
switch(c.type) {
case Constraint::COMMENT:
c.disp.offset = c.disp.offset.Plus(trans);
break;
case Constraint::PT_PT_DISTANCE:
case Constraint::PT_LINE_DISTANCE:
case Constraint::PROJ_PT_DISTANCE:
case Constraint::DIAMETER:
c.valA *= fabs(scale);
break;
default:
break;
}
hConstraint hc = Constraint::AddConstraint(&c, /*rememberForUndo=*/false);
if(c.type == Constraint::COMMENT) {
SK.GetConstraint(hc)->disp.offset = SK.GetConstraint(hc)->disp.offset.Plus(trans);
MakeSelected(hc);
}
}