TD: add units for line widths
- this also prevents negative values - also fix an issue in DrawViewBalloon introduced by me recently
This commit is contained in:
@@ -136,8 +136,8 @@ void DrawViewBalloon::handleChangedPropertyType(Base::XMLReader &reader, const c
|
||||
|
||||
// property OriginX had the App::PropertyFloat and was changed to App::PropertyLength
|
||||
if (prop == &OriginX && strcmp(TypeName, "App::PropertyFloat") == 0) {
|
||||
App::PropertyInteger OriginXProperty;
|
||||
// restore the PropertyInteger to be able to set its value
|
||||
App::PropertyFloat OriginXProperty;
|
||||
// restore the PropertyFloat to be able to set its value
|
||||
OriginXProperty.Restore(reader);
|
||||
OriginX.setValue(OriginXProperty.getValue());
|
||||
}
|
||||
|
||||
@@ -215,3 +215,33 @@ TechDraw::DrawViewPart* ViewProviderViewPart::getViewPart() const
|
||||
{
|
||||
return getViewObject();
|
||||
}
|
||||
|
||||
void ViewProviderViewPart::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop)
|
||||
// transforms properties that had been changed
|
||||
{
|
||||
// property LineWidth had the App::PropertyFloat and was changed to App::PropertyLength
|
||||
if (prop == &LineWidth && strcmp(TypeName, "App::PropertyFloat") == 0) {
|
||||
App::PropertyFloat LineWidthProperty;
|
||||
// restore the PropertyFloat to be able to set its value
|
||||
LineWidthProperty.Restore(reader);
|
||||
LineWidth.setValue(LineWidthProperty.getValue());
|
||||
}
|
||||
// property HiddenWidth had the App::PropertyFloat and was changed to App::PropertyLength
|
||||
else if (prop == &HiddenWidth && strcmp(TypeName, "App::PropertyFloat") == 0) {
|
||||
App::PropertyFloat HiddenWidthProperty;
|
||||
HiddenWidthProperty.Restore(reader);
|
||||
HiddenWidth.setValue(HiddenWidthProperty.getValue());
|
||||
}
|
||||
// property IsoWidth had the App::PropertyFloat and was changed to App::PropertyLength
|
||||
else if (prop == &IsoWidth && strcmp(TypeName, "App::PropertyFloat") == 0) {
|
||||
App::PropertyFloat IsoWidthProperty;
|
||||
IsoWidthProperty.Restore(reader);
|
||||
IsoWidth.setValue(IsoWidthProperty.getValue());
|
||||
}
|
||||
// property ExtraWidth had the App::PropertyFloat and was changed to App::PropertyLength
|
||||
else if (prop == &ExtraWidth && strcmp(TypeName, "App::PropertyFloat") == 0) {
|
||||
App::PropertyFloat ExtraWidthProperty;
|
||||
ExtraWidthProperty.Restore(reader);
|
||||
ExtraWidth.setValue(ExtraWidthProperty.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ public:
|
||||
/// destructor
|
||||
virtual ~ViewProviderViewPart();
|
||||
|
||||
App::PropertyFloat LineWidth;
|
||||
App::PropertyFloat HiddenWidth;
|
||||
App::PropertyFloat IsoWidth;
|
||||
App::PropertyFloat ExtraWidth;
|
||||
App::PropertyLength LineWidth;
|
||||
App::PropertyLength HiddenWidth;
|
||||
App::PropertyLength IsoWidth;
|
||||
App::PropertyLength ExtraWidth;
|
||||
App::PropertyBool ArcCenterMarks;
|
||||
App::PropertyFloat CenterScale;
|
||||
App::PropertyBool HorizCenterLine;
|
||||
@@ -64,6 +64,8 @@ public:
|
||||
public:
|
||||
virtual void onChanged(const App::Property *prop);
|
||||
virtual void updateData(const App::Property*);
|
||||
virtual void handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property * prop);
|
||||
|
||||
|
||||
virtual std::vector<App::DocumentObject*> claimChildren(void) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user