Skip to content

Commit

Permalink
[TD] Add Balloon property LineVisible for making the Balloon line vis…
Browse files Browse the repository at this point in the history
…ible or hidden.
  • Loading branch information
aapo-aapo committed Dec 7, 2020
1 parent 438169b commit c39ede3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Mod/TechDraw/App/DrawViewBalloon.cpp
Expand Up @@ -113,6 +113,8 @@ DrawViewBalloon::DrawViewBalloon(void)
ADD_PROPERTY_TYPE(KinkLength,(prefKinkLength()),"",(App::PropertyType)(App::Prop_None),
"Distance from symbol to leader kink");

ADD_PROPERTY_TYPE(LineVisible,(true),"",(App::PropertyType)(App::Prop_None),"Balloon line visible or hidden");

SourceView.setScope(App::LinkScope::Global);
Rotation.setStatus(App::Property::Hidden,true);
Caption.setStatus(App::Property::Hidden,true);
Expand Down
1 change: 1 addition & 0 deletions src/Mod/TechDraw/App/DrawViewBalloon.h
Expand Up @@ -59,6 +59,7 @@ class TechDrawExport DrawViewBalloon : public TechDraw::DrawView
App::PropertyDistance OriginY;
App::PropertyFloat TextWrapLen;
App::PropertyDistance KinkLength;
App::PropertyBool LineVisible;

short mustExecute() const override;

Expand Down
7 changes: 6 additions & 1 deletion src/Mod/TechDraw/Gui/QGIViewBalloon.cpp
Expand Up @@ -738,7 +738,7 @@ void QGIViewBalloon::draw()
float arAngle = atan2(dirballoonLinesLine.y, dirballoonLinesLine.x) * 180 / M_PI;

arrow->setPos(arrowTipX, arrowTipY);
if ( (endType == ArrowType::FILLED_TRIANGLE) &&
if ( (endType == ArrowType::FILLED_TRIANGLE) &&
(prefOrthoPyramid()) ) {
if (arAngle < 0.0) {
arAngle += 360.0;
Expand All @@ -765,6 +765,11 @@ void QGIViewBalloon::draw()
dLinePath.lineTo(arrowTipX - xAdj, arrowTipY - yAdj);
balloonLines->setPath(dLinePath);

if (!balloon->LineVisible.getValue()) {
arrow->hide();
balloonLines->setPath(QPainterPath());
}

// redraw the Balloon and the parent View
if (hasHover && !isSelected()) {
setPrettyPre();
Expand Down

0 comments on commit c39ede3

Please sign in to comment.