Skip to content

Commit

Permalink
Use circles for digitized point marker, not square
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 19, 2022
1 parent a6ede27 commit ec6cf0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -57,6 +57,8 @@ std::unique_ptr<QgsHighlight> QgsMapToolAddFeature::createHighlight( QgsVectorLa
{
std::unique_ptr< QgsHighlight > highlight = std::make_unique< QgsHighlight >( mCanvas, f.geometry(), layer );
highlight->applyDefaultStyle();
highlight->mPointSizeRadiusMM = 1.0;
highlight->mPointSymbol = QgsHighlight::PointSymbol::Circle;
return highlight;
};

Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgshighlight.cpp
Expand Up @@ -414,9 +414,9 @@ void QgsHighlight::paint( QPainter *p )
setRenderContextVariables( p, mRenderContext );

// default to 1.5 mm radius square points
double pointSizeRadius = 1.5;
double pointSizeRadius = mPointSizeRadiusMM;
QgsUnitTypes::RenderUnit sizeUnit = QgsUnitTypes::RenderMillimeters;
PointSymbol symbol = Square;
PointSymbol symbol = mPointSymbol;

// but for point clouds, use actual sizes (+a little margin!)
if ( QgsPointCloudLayer *pcLayer = qobject_cast<QgsPointCloudLayer *>( mLayer ) )
Expand Down
5 changes: 5 additions & 0 deletions src/gui/qgshighlight.h
Expand Up @@ -217,6 +217,11 @@ class GUI_EXPORT QgsHighlight : public QgsMapCanvasItem
double mBuffer = 0; // line / stroke buffer in pixels
double mMinWidth = 0; // line / stroke minimum width in pixels
QgsRenderContext mRenderContext;

// we don't want to make PointSymbol public for now, so just grant access selectively via a friend
friend class QgsMapToolAddFeature;
double mPointSizeRadiusMM = 1.5;
PointSymbol mPointSymbol = PointSymbol::Square;
};

#endif

0 comments on commit ec6cf0a

Please sign in to comment.