TechDraw: add unit for rotation

This commit is contained in:
donovaly
2019-12-01 20:44:07 +01:00
committed by WandererFan
parent 004d6061e0
commit 2fa9369d42
2 changed files with 14 additions and 21 deletions

View File

@@ -60,9 +60,9 @@ using namespace TechDraw;
//===========================================================================
const char* DrawView::ScaleTypeEnums[]= {"Page",
"Automatic",
"Custom",
NULL};
"Automatic",
"Custom",
NULL};
App::PropertyFloatConstraint::Constraints DrawView::scaleRange = {Precision::Confusion(),
std::numeric_limits<double>::max(),
pow(10,- Base::UnitsApi::getDecimals())};
@@ -340,12 +340,12 @@ void DrawView::handleChangedPropertyType(
Scale.setValue(1.0);
}
} else {
// has Scale property that isn't float
Base::Console().Log("DrawPage::Restore - old document Scale is not a float!\n");
// has Scale prop that isn't Float!
Base::Console().Log("DrawPage::Restore - old Document Scale is Not Float!\n");
// no idea
}
} else if (prop->isDerivedFrom(App::PropertyLinkList::getClassTypeId())
&& strcmp(prop->getName(),"Source")==0)
{
&& strcmp(prop->getName(),"Source")==0) {
App::PropertyLinkGlobal glink;
App::PropertyLink link;
if (strcmp(glink.getTypeId().getName(),TypeName) == 0) { //property in file is plg
@@ -363,19 +363,12 @@ void DrawView::handleChangedPropertyType(
static_cast<App::PropertyLinkList*>(prop)->setValue(link.getValue());
}
}
// property X had App::PropertyFloat and was changed to App::PropertyLength
// sb PropertyDistance. some X,Y are relative to existing point on page
} else if (prop == &X && strcmp(TypeName, "App::PropertyFloat") == 0) {
App::PropertyFloat XProperty;
XProperty.setContainer(this);
// restore the PropertyFloat to be able to set its value
XProperty.Restore(reader);
X.setValue(XProperty.getValue());
} else if (prop == &Y && strcmp(TypeName, "App::PropertyFloat") == 0) {
App::PropertyFloat YProperty;
YProperty.setContainer(this);
YProperty.Restore(reader);
Y.setValue(YProperty.getValue());
// property Rotation had App::PropertyFloat and was changed to App::PropertyAngle
} else if (prop == &Rotation && strcmp(TypeName, "App::PropertyFloat") == 0) {
App::PropertyFloat RotationProperty;
RotationProperty.setContainer(this);
RotationProperty.Restore(reader);
Rotation.setValue(RotationProperty.getValue());
}
}

View File

@@ -58,7 +58,7 @@ public:
App::PropertyFloatConstraint Scale;
App::PropertyEnumeration ScaleType;
App::PropertyFloat Rotation;
App::PropertyAngle Rotation;
App::PropertyString Caption;
/** @name methods override Feature */