Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[TD] Add Balloon property EndTypeScale for scaling line end decoratio…
…ns (arrows etc).
  • Loading branch information
aapo-aapo committed Dec 7, 2020
1 parent 78c6cc1 commit 438169b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/Mod/TechDraw/App/DrawViewBalloon.cpp
Expand Up @@ -105,6 +105,9 @@ DrawViewBalloon::DrawViewBalloon(void)
ADD_PROPERTY_TYPE(ShapeScale,(1.0),"",(App::PropertyType)(App::Prop_None),"Balloon shape scale");
ShapeScale.setConstraints(&SymbolScaleRange);

ADD_PROPERTY_TYPE(EndTypeScale,(1.0),"",(App::PropertyType)(App::Prop_None),"EndType shape scale");
ShapeScale.setConstraints(&SymbolScaleRange);

ADD_PROPERTY_TYPE(TextWrapLen,(-1),"",(App::PropertyType)(App::Prop_None),"Text wrap length; -1 means no wrap");

ADD_PROPERTY_TYPE(KinkLength,(prefKinkLength()),"",(App::PropertyType)(App::Prop_None),
Expand Down
17 changes: 9 additions & 8 deletions src/Mod/TechDraw/App/DrawViewBalloon.h
Expand Up @@ -49,15 +49,16 @@ class TechDrawExport DrawViewBalloon : public TechDraw::DrawView
DrawViewBalloon();
virtual ~DrawViewBalloon();

App::PropertyLink SourceView;
App::PropertyString Text;
App::PropertyEnumeration EndType;
App::PropertyEnumeration BubbleShape;
App::PropertyLink SourceView;
App::PropertyString Text;
App::PropertyEnumeration EndType;
App::PropertyEnumeration BubbleShape;
App::PropertyFloatConstraint ShapeScale;
App::PropertyDistance OriginX;
App::PropertyDistance OriginY;
App::PropertyFloat TextWrapLen;
App::PropertyDistance KinkLength;
App::PropertyFloatConstraint EndTypeScale;
App::PropertyDistance OriginX;
App::PropertyDistance OriginY;
App::PropertyFloat TextWrapLen;
App::PropertyDistance KinkLength;

short mustExecute() const override;

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/Gui/QGIViewBalloon.cpp
Expand Up @@ -717,14 +717,14 @@ void QGIViewBalloon::draw()
double yAdj = 0.0;
int endType = balloon->EndType.getValue();
double arrowAdj = QGIArrow::getOverlapAdjust(endType,
QGIArrow::getPrefArrowSize());
balloon->EndTypeScale.getValue()*QGIArrow::getPrefArrowSize());

if (endType == ArrowType::NONE) {
arrow->hide();
} else {
arrow->setStyle(endType);

arrow->setSize(QGIArrow::getPrefArrowSize());
arrow->setSize(balloon->EndTypeScale.getValue()*QGIArrow::getPrefArrowSize());
arrow->draw();

Base::Vector3d arrowTipPos(arrowTipX, arrowTipY, 0.0);
Expand Down

0 comments on commit 438169b

Please sign in to comment.