Multiply constraint values by scale when pasting with transformation.
parent
33e292a6bc
commit
8747745a14
|
@ -22,6 +22,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
|
||||
---
|
||||
|
|
|
@ -214,9 +214,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::Type::COMMENT:
|
||||
c.disp.offset = c.disp.offset.Plus(trans);
|
||||
break;
|
||||
|
||||
case Constraint::Type::PT_PT_DISTANCE:
|
||||
case Constraint::Type::PT_LINE_DISTANCE:
|
||||
case Constraint::Type::PROJ_PT_DISTANCE:
|
||||
case Constraint::Type::DIAMETER:
|
||||
c.valA *= fabs(scale);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
hConstraint hc = Constraint::AddConstraint(&c, /*rememberForUndo=*/false);
|
||||
if(c.type == Constraint::Type::COMMENT) {
|
||||
SK.GetConstraint(hc)->disp.offset = SK.GetConstraint(hc)->disp.offset.Plus(trans);
|
||||
MakeSelected(hc);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue