[TD]handle ScaleType in old documents
This commit is contained in:
committed by
WandererFan
parent
dd1b0e0a3d
commit
bbffb3f413
@@ -170,6 +170,7 @@ void DrawProjGroupItem::autoPosition()
|
||||
void DrawProjGroupItem::onDocumentRestored()
|
||||
{
|
||||
// Base::Console().Message("DPGI::onDocumentRestored() - %s\n", getNameInDocument());
|
||||
DrawView::onDocumentRestored();
|
||||
App::DocumentObjectExecReturn* rc = DrawProjGroupItem::execute();
|
||||
if (rc) {
|
||||
delete rc;
|
||||
|
||||
@@ -239,8 +239,33 @@ void DrawView::onDocumentRestored()
|
||||
{
|
||||
handleXYLock();
|
||||
setScaleAttribute();
|
||||
validateScale();
|
||||
DrawView::execute();
|
||||
}
|
||||
|
||||
//in versions before 0.20 Scale and ScaleType were mishandled.
|
||||
//In order to not introduce unintended drawing changes in later
|
||||
//versions, ScaleType Page must be modified if view Scale does
|
||||
//not match Page Scale
|
||||
void DrawView::validateScale()
|
||||
{
|
||||
if (ScaleType.isValue("Custom")) {
|
||||
//nothing to do here
|
||||
return;
|
||||
}
|
||||
DrawPage* page = findParentPage();
|
||||
if (page) {
|
||||
if (ScaleType.isValue("Page")) {
|
||||
double pageScale = page->Scale.getValue();
|
||||
double myScale = Scale.getValue();
|
||||
if (!DrawUtil::fpCompare(pageScale, myScale)) {
|
||||
ScaleType.setValue("Custom");
|
||||
ScaleType.purgeTouched();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DrawView::countParentPages
|
||||
* Fixes a crash in TechDraw when user creates duplicate page without dependencies
|
||||
|
||||
@@ -109,6 +109,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void onChanged(const App::Property* prop) override;
|
||||
virtual void validateScale();
|
||||
std::string pageFeatName;
|
||||
bool autoPos;
|
||||
bool mouseMove;
|
||||
|
||||
Reference in New Issue
Block a user