mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Slightly improved markers for highlighted nodes and circular nodes
This commit is contained in:
parent
52113d7c38
commit
61ace1cc61
@ -13,7 +13,9 @@ class QgsRubberBand: QgsMapCanvasItem
|
||||
ICON_X,
|
||||
ICON_BOX,
|
||||
ICON_CIRCLE,
|
||||
ICON_FULL_BOX
|
||||
ICON_FULL_BOX,
|
||||
ICON_DIAMOND,
|
||||
ICON_FULL_DIAMOND
|
||||
};
|
||||
|
||||
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::LineGeometry );
|
||||
|
@ -656,7 +656,7 @@ void QgsNodeTool2::mouseMoveNotDragging( QgsMapMouseEvent *e )
|
||||
isCircular = isCircularVertex( cachedGeometry( m.layer(), m.featureId() ), m.vertexIndex() );
|
||||
}
|
||||
|
||||
mVertexBand->setIcon( isCircular ? QgsRubberBand::ICON_FULL_BOX : QgsRubberBand::ICON_CIRCLE );
|
||||
mVertexBand->setIcon( isCircular ? QgsRubberBand::ICON_FULL_DIAMOND : QgsRubberBand::ICON_CIRCLE );
|
||||
// if we are at an endpoint, let's show also the endpoint indicator
|
||||
// so user can possibly add a new vertex at the end
|
||||
if ( isMatchAtEndpoint( m ) )
|
||||
@ -1436,6 +1436,7 @@ void QgsNodeTool2::setHighlightedNodes( const QList<Vertex> &listNodes )
|
||||
marker->setIconType( QgsVertexMarker::ICON_CIRCLE );
|
||||
marker->setPenWidth( 3 );
|
||||
marker->setColor( Qt::blue );
|
||||
marker->setFillColor( Qt::blue );
|
||||
marker->setCenter( toMapCoordinates( node.layer, geom.vertexAt( node.vertexId ) ) );
|
||||
mSelectedNodesMarkers.append( marker );
|
||||
}
|
||||
|
@ -519,6 +519,22 @@ void QgsRubberBand::drawShape( QPainter *p, QVector<QPointF> &pts )
|
||||
case ICON_CIRCLE:
|
||||
p->drawEllipse( x - s, y - s, mIconSize, mIconSize );
|
||||
break;
|
||||
|
||||
case ICON_DIAMOND:
|
||||
case ICON_FULL_DIAMOND:
|
||||
{
|
||||
QPointF pts[] =
|
||||
{
|
||||
QPointF( x, y - s ),
|
||||
QPointF( x + s, y ),
|
||||
QPointF( x, y + s ),
|
||||
QPointF( x - s, y )
|
||||
};
|
||||
if ( mIconType == ICON_FULL_DIAMOND )
|
||||
p->drawPolygon( pts, 4 );
|
||||
else
|
||||
p->drawPolyline( pts, 4 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,19 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
|
||||
/**
|
||||
* A full box is used to highlight points (■)
|
||||
*/
|
||||
ICON_FULL_BOX
|
||||
ICON_FULL_BOX,
|
||||
|
||||
/**
|
||||
* A diamond is used to highlight points (◇)
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
ICON_DIAMOND,
|
||||
|
||||
/**
|
||||
* A diamond is used to highlight points (◆)
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
ICON_FULL_DIAMOND,
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user