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.

(cherry picked from commit 235fee1)
  • Loading branch information
nyalldawson authored and nirvn committed Dec 15, 2019
1 parent 469a66a commit a8cd06afd3dda7bbea727cd167f32f9fce6d5f8d
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/app/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 a8cd06a

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