Skip to content

Commit

Permalink
Fix bad icon drawn on top of points when rotating labels
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 4, 2017
1 parent 0f407e1 commit d1d5e6c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/app/qgsmaptoolrotatelabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ void QgsMapToolRotateLabel::canvasPressEvent( QgsMapMouseEvent *e )

mRotationItem = new QgsPointRotationItem( mCanvas );
mRotationItem->setOrientation( QgsPointRotationItem::Clockwise );
mRotationItem->setSymbol( QgsApplication::getThemePixmap( QStringLiteral( "mActionRotatePointSymbols.svg" ) ).toImage() );
mRotationItem->setPointLocation( mRotationPoint );
mRotationItem->setSymbolRotation( mCurrentRotation );
}
Expand Down
10 changes: 3 additions & 7 deletions src/app/qgspointrotationitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ QgsPointRotationItem::QgsPointRotationItem( QgsMapCanvas *canvas )
//setup font
mFont.setPointSize( 12 );
mFont.setBold( true );
}

QgsPointRotationItem::QgsPointRotationItem()
: QgsMapCanvasItem( nullptr )
, mOrientation( Clockwise )
, mRotation( 0.0 )
{

QImage im( 24, 24, QImage::Format_ARGB32 );
im.fill( Qt::transparent );
setSymbol( im );
}

QgsPointRotationItem::~QgsPointRotationItem()
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgspointrotationitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class APP_EXPORT QgsPointRotationItem: public QgsMapCanvasItem
Orientation orientation() const { return mOrientation; }

private:
QgsPointRotationItem();

//! Converts rotation into QPainter rotation considering mOrientation
int painterRotation( int rotation ) const;
//! Clockwise (default) or counterclockwise
Expand Down

0 comments on commit d1d5e6c

Please sign in to comment.