Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[composer] Snap items to page edge, not page outlines or shadow (fix #…
  • Loading branch information
nyalldawson committed Jan 30, 2014
1 parent 0f590db commit 3994c98
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/composer/qgscomposermousehandles.cpp
Expand Up @@ -22,6 +22,7 @@
#include "qgscomposermousehandles.h"
#include "qgscomposeritem.h"
#include "qgscomposition.h"
#include "qgspaperitem.h"
#include "qgis.h"
#include "qgslogger.h"

Expand Down Expand Up @@ -1185,7 +1186,17 @@ void QgsComposerMouseHandles::collectAlignCoordinates( QMap< double, const QgsCo
{
continue;
}
QRectF itemRect = currentItem->sceneBoundingRect();
QRectF itemRect;
if ( dynamic_cast<const QgsPaperItem *>( *itemIt ) )
{
//if snapping to paper use the paper item's rect rather then the bounding rect,
//since we want to snap to the page edge and not any outlines drawn around the page
itemRect = currentItem->rect();
}
else
{
itemRect = currentItem->sceneBoundingRect();
}
alignCoordsX.insert( itemRect.left(), currentItem );
alignCoordsX.insert( itemRect.right(), currentItem );
alignCoordsX.insert( itemRect.center().x(), currentItem );
Expand Down

0 comments on commit 3994c98

Please sign in to comment.