[TD] Add Balloon property LineVisible for making the Balloon line visible or hidden.

This commit is contained in:
Aapo
2020-11-21 00:26:49 +02:00
parent 438169b335
commit c39ede3b5f
3 changed files with 9 additions and 1 deletions

View File

@@ -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);

View File

@@ -59,6 +59,7 @@ public:
App::PropertyDistance OriginY;
App::PropertyFloat TextWrapLen;
App::PropertyDistance KinkLength;
App::PropertyBool LineVisible;
short mustExecute() const override;

View File

@@ -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;
@@ -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();