Skip to content

Commit

Permalink
Fix DrawViewAnnotation TextSize
Browse files Browse the repository at this point in the history
- text size was originally specified in integer
  point size.  Now they are specified in mm. The
  relevant Properties have been changed to
  PropertyLength.
  • Loading branch information
WandererFan authored and wwmayer committed Feb 22, 2018
1 parent 12f3258 commit c606bbb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Mod/TechDraw/App/DrawViewAnnotation.cpp
Expand Up @@ -66,9 +66,9 @@ DrawViewAnnotation::DrawViewAnnotation(void)
ADD_PROPERTY_TYPE(Font ,(fontName.c_str()),vgroup,App::Prop_None, "The name of the font to use");
ADD_PROPERTY_TYPE(TextColor,(0.0f,0.0f,0.0f),vgroup,App::Prop_None,"The color of the text");

ADD_PROPERTY_TYPE(TextSize,(8),vgroup,App::Prop_None,"The size of the text in mm");
ADD_PROPERTY_TYPE(TextSize,(8.0),vgroup,App::Prop_None,"The size of the text in units");
ADD_PROPERTY_TYPE(MaxWidth,(-1.0),vgroup,App::Prop_None,"The maximum width of the Annotation block");
ADD_PROPERTY_TYPE(LineSpace,(80),vgroup,App::Prop_None,"Line spacing adjustment");
ADD_PROPERTY_TYPE(LineSpace,(80),vgroup,App::Prop_None,"Line spacing adjustment. 100 is normal spacing.");

TextStyle.setEnums(TextStyleEnums);
ADD_PROPERTY(TextStyle, ((long)0));
Expand Down Expand Up @@ -120,7 +120,7 @@ QRectF DrawViewAnnotation::getRect() const
}

App::DocumentObjectExecReturn *DrawViewAnnotation::execute(void)
{
{
requestPaint();
return TechDraw::DrawView::execute();
}
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/TechDraw/App/DrawViewAnnotation.h
Expand Up @@ -30,6 +30,7 @@
#include <App/DocumentObject.h>
#include <App/PropertyLinks.h>
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/FeaturePython.h>

#include "DrawView.h"
Expand All @@ -50,7 +51,7 @@ class TechDrawExport DrawViewAnnotation : public TechDraw::DrawView
App::PropertyStringList Text;
App::PropertyFont Font;
App::PropertyColor TextColor;
App::PropertyInteger TextSize;
App::PropertyLength TextSize;
App::PropertyInteger LineSpace;
App::PropertyEnumeration TextStyle; // Plain,Bold,Italic,Bold-Italic
App::PropertyFloat MaxWidth;
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/ViewProviderDimension.cpp
Expand Up @@ -62,7 +62,7 @@ ViewProviderDimension::ViewProviderDimension()
double fontSize = hGrp->GetFloat("FontSize", 3.5);

ADD_PROPERTY_TYPE(Font ,(fontName.c_str()),group,App::Prop_None, "The name of the font to use");
ADD_PROPERTY_TYPE(Fontsize,(fontSize) ,group,(App::PropertyType)(App::Prop_None),"Dimension text size in mm");
ADD_PROPERTY_TYPE(Fontsize,(fontSize) ,group,(App::PropertyType)(App::Prop_None),"Dimension text size in units");

hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
Expand Down
10 changes: 6 additions & 4 deletions src/Mod/TechDraw/Gui/ViewProviderDimension.h
Expand Up @@ -25,6 +25,8 @@
#ifndef DRAWINGGUI_VIEWPROVIDERDIMENSION_H
#define DRAWINGGUI_VIEWPROVIDERDIMENSION_H

#include <App/PropertyUnits.h>

#include "ViewProviderDrawingView.h"
#include <Mod/TechDraw/App/DrawViewDimension.h>

Expand All @@ -42,10 +44,10 @@ class TechDrawGuiExport ViewProviderDimension : public ViewProviderDrawingView
/// destructor
virtual ~ViewProviderDimension();

App::PropertyFont Font;
App::PropertyFloat Fontsize;
App::PropertyFloat LineWidth;
App::PropertyColor Color;
App::PropertyFont Font;
App::PropertyLength Fontsize;
App::PropertyFloat LineWidth;
App::PropertyColor Color;


virtual void attach(App::DocumentObject *);
Expand Down

0 comments on commit c606bbb

Please sign in to comment.