From 17098d011ceaeab32e50461d06bb0456c45fcd05 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 10 Apr 2017 14:32:42 +0200 Subject: [PATCH] Sketcher: Carbon Copy - Correct inverted logic (worked but it is not clear) --- src/Mod/Sketcher/App/SketchObject.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index cb318d4e20..4feaca8b68 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -2109,8 +2109,8 @@ bool SketchObject::isCarbonCopyAllowed(App::Document *pDoc, App::DocumentObject return false; } - xinv = allowUnaligned?false:(dotx == 1.0); - yinv = allowUnaligned?false:(doty == 1.0); + xinv = allowUnaligned?false:(dotx != 1.0); + yinv = allowUnaligned?false:(doty != 1.0); return true; } @@ -4335,11 +4335,12 @@ int SketchObject::carbonCopy(App::DocumentObject * pObj, bool construction) App::ObjectIdentifier spath = psObj->Constraints.createPath(sourceid); if(xinv) { - boost::shared_ptr expr(App::Expression::parse(this, spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); + boost::shared_ptr expr(App::Expression::parse(this, std::string(1,'-') + spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); setExpression(Constraints.createPath(nextcid), expr); } else { - boost::shared_ptr expr(App::Expression::parse(this, std::string(1,'-') + spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); + boost::shared_ptr expr(App::Expression::parse(this, spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); + setExpression(Constraints.createPath(nextcid), expr); } } @@ -4352,11 +4353,11 @@ int SketchObject::carbonCopy(App::DocumentObject * pObj, bool construction) App::ObjectIdentifier spath = psObj->Constraints.createPath(sourceid); if(yinv) { - boost::shared_ptr expr(App::Expression::parse(this, spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); + boost::shared_ptr expr(App::Expression::parse(this, std::string(1,'-') + spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); setExpression(Constraints.createPath(nextcid), expr); } else { - boost::shared_ptr expr(App::Expression::parse(this, std::string(1,'-') + spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); + boost::shared_ptr expr(App::Expression::parse(this, spath.getDocumentObjectName().getString() +std::string(1,'.') + spath.toString())); setExpression(Constraints.createPath(nextcid), expr); } }