Skip to content
Permalink
Browse files

Don't highlight whole polygon in red when using map label tools

For polygons, we don't want to fill the whole polygon itself with
the rubber band as that obscures too much of the map and prevents
users from getting a good view of the underlying map.

Instead, just use the boundary of the polygon for the rubber band.
That's enough to give a visual indicator of the feature associated
with the label without getting in the way.
  • Loading branch information
nyalldawson committed Dec 15, 2019
1 parent dbdc397 commit 235fee19ec6ad8a4f1b2132754bb2e5f09abca17
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/app/labeling/qgsmaptoollabel.cpp
@@ -132,6 +132,14 @@ void QgsMapToolLabel::createRubberBands()
QgsGeometry geom = f.geometry();
if ( !geom.isNull() )
{
if ( geom.type() == QgsWkbTypes::PolygonGeometry )
{
// for polygons, we don't want to fill the whole polygon itself with the rubber band
// as that obscures too much of the map and prevents users from getting a good view of
// the underlying map
// instead, just use the boundary of the polygon for the rubber band
geom = QgsGeometry( geom.constGet()->boundary() );
}
QgsSettings settings;
int r = settings.value( QStringLiteral( "qgis/digitizing/line_color_red" ), 255 ).toInt();
int g = settings.value( QStringLiteral( "qgis/digitizing/line_color_green" ), 0 ).toInt();

0 comments on commit 235fee1

Please sign in to comment.
You can’t perform that action at this time.