From 0935aa9f5c446ef493e45abb3eba5ffc1af9f57d Mon Sep 17 00:00:00 2001 From: wandererfan Date: Tue, 3 Dec 2019 08:34:02 -0500 Subject: [PATCH] [TD]fix Jumping Dimensions - X,Y were changed to PropertyLength (>0), but some X,Y are relative, so X,Y sb PropertyDistance. --- src/Mod/TechDraw/App/DrawView.cpp | 28 +++++++++++++--------------- src/Mod/TechDraw/App/DrawView.h | 4 ++-- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index f753c4d05b..0382f91259 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -363,22 +363,20 @@ void DrawView::handleChangedPropertyType( static_cast(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 X had App::PropertyFloat and was changed to App::PropertyLength - 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()); - } - // property Y had App::PropertyFloat and was changed to App::PropertyLength - else if (prop == &Y && strcmp(TypeName, "App::PropertyFloat") == 0) { - App::PropertyFloat YProperty; - YProperty.setContainer(this); - YProperty.Restore(reader); - Y.setValue(YProperty.getValue()); - } } bool DrawView::keepUpdated(void) diff --git a/src/Mod/TechDraw/App/DrawView.h b/src/Mod/TechDraw/App/DrawView.h index dc8378accc..34782a662c 100644 --- a/src/Mod/TechDraw/App/DrawView.h +++ b/src/Mod/TechDraw/App/DrawView.h @@ -52,8 +52,8 @@ public: DrawView(void); virtual ~DrawView(); - App::PropertyLength X; - App::PropertyLength Y; + App::PropertyDistance X; + App::PropertyDistance Y; App::PropertyBool LockPosition; App::PropertyFloatConstraint Scale;