Skip to content

Commit

Permalink
Enable composition mode for advanced drawing (#6009)
Browse files Browse the repository at this point in the history
* Enable composition mode for advanced drawing

Makes the lines pop off the map more and not get lost in the background.

Also adjusts the line size up to 1 as .7 it really small.
  • Loading branch information
NathanW2 committed Jan 8, 2018
1 parent 3d36653 commit 617459d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/gui/qgsadvanceddigitizingcanvasitem.cpp
Expand Up @@ -22,12 +22,12 @@

QgsAdvancedDigitizingCanvasItem::QgsAdvancedDigitizingCanvasItem( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget )
: QgsMapCanvasItem( canvas )
, mLockedPen( QPen( QColor( 100, 100, 255, 255 ), .7, Qt::DashLine ) )
, mConstruction1Pen( QPen( QColor( 100, 255, 100, 150 ), .7, Qt::DashLine ) )
, mConstruction2Pen( QPen( QColor( 100, 255, 100, 255 ), .7, Qt::DashLine ) )
, mSnapPen( QPen( QColor( 255, 175, 100, 150 ), 7 ) )
, mSnapLinePen( QPen( QColor( 200, 100, 50, 150 ), .7, Qt::DashLine ) )
, mCursorPen( QPen( QColor( 100, 255, 100, 255 ), .7 ) )
, mLockedPen( QPen( QColor( 0, 127, 0, 255 ), 1, Qt::DashLine ) )
, mConstruction1Pen( QPen( QColor( 127, 127, 127, 150 ), 1, Qt::DashLine ) )
, mConstruction2Pen( QPen( QColor( 127, 127, 127, 255 ), 1, Qt::DashLine ) )
, mSnapPen( QPen( QColor( 127, 0, 0, 150 ), 1 ) )
, mSnapLinePen( QPen( QColor( 127, 0, 0, 150 ), 1, Qt::DashLine ) )
, mCursorPen( QPen( QColor( 127, 127, 127, 255 ), 1 ) )
, mAdvancedDigitizingDockWidget( cadDockWidget )
{
}
Expand Down Expand Up @@ -80,6 +80,7 @@ void QgsAdvancedDigitizingCanvasItem::paint( QPainter *painter )
}

painter->setRenderHints( QPainter::Antialiasing );
painter->setCompositionMode( QPainter::CompositionMode_Difference );

// Draw point snap
if ( curPointExist && snappedToVertex )
Expand Down

0 comments on commit 617459d

Please sign in to comment.