Skip to content

Commit

Permalink
Fix 2843 DrawProjGroup Restore
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan authored and wwmayer committed Jan 14, 2017
1 parent 2fef05c commit d8afbe5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Mod/TechDraw/App/DrawProjGroup.cpp
Expand Up @@ -1023,21 +1023,27 @@ void DrawProjGroup::onDocumentRestored()
} else if (hasProjection("Front")) {
Base::Vector3d dirFront = getProjItem("Front")->Direction.getValue();
std::string viewDir = Cube::dirToView(dirFront);
Base::Vector3d rotFront = getProjItem("Rot")->RotationVector.getValue();
Base::Vector3d rotFront(1.0,0.0,0.0);
App::Property* prop = getPropertyByName("RotationVector");
if (prop) {
Base::Console().Log("INFO - DPG::onRestore - DPG has RotationVector property\n");
rotFront = getProjItem("Front")->RotationVector.getValue();
} else {
Base::Console().Log("INFO - DPG::onRestore - DPG has NO RotationVector property\n");
}
std::string viewRot = Cube::dirToView(rotFront);
std::string config = viewDir + viewRot;
//find(config) or try/catch
try {
config = m_dirRotToConfig.at(config);
setConfig(config);
}
catch (...) {
Base::Console().Message("ERROR: DPG cannot set configuration: %s using AD\n",config.c_str());
Base::Console().Message("PROBLEM: DPG cannot set configuration: %s using default instead\n",config.c_str());
setConfig("AD");
}
} else {
Base::Console().Message("ERROR: DPG cannot find Front view on restore\n");
setConfig("AD"); // set to default config??
Base::Console().Message("PROBLEM: DPG cannot find Front view on restore. Using default instead.\n");
setConfig("AD");
}
}

Expand Down

0 comments on commit d8afbe5

Please sign in to comment.