Skip to content

Commit eb2b181

Browse files
committedOct 9, 2017
When a grouped item is selected, we only draw the individual item
bounds (not the group bounds)
1 parent 7c81a15 commit eb2b181

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎src/gui/layout/qgslayoutmousehandles.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "qgslayoutview.h"
2626
#include "qgslayoutviewtoolselect.h"
2727
#include "qgslayoutsnapper.h"
28+
#include "qgslayoutitemgroup.h"
2829
#include <QGraphicsView>
2930
#include <QGraphicsSceneHoverEvent>
3031
#include <QPainter>
@@ -130,7 +131,22 @@ void QgsLayoutMouseHandles::drawSelectedItemBounds( QPainter *painter )
130131
painter->setPen( selectedItemPen );
131132
painter->setBrush( Qt::NoBrush );
132133

134+
QList< QgsLayoutItem * > itemsToDraw;
133135
for ( QgsLayoutItem *item : selectedItems )
136+
{
137+
if ( item->type() == QgsLayoutItemRegistry::LayoutGroup )
138+
{
139+
// if a group is selected, we don't draw the bounds of the group - instead we draw the bounds of the grouped items
140+
itemsToDraw.append( static_cast< QgsLayoutItemGroup * >( item )->items() );
141+
}
142+
else
143+
{
144+
itemsToDraw << item;
145+
}
146+
147+
}
148+
149+
for ( QgsLayoutItem *item : qgsAsConst( itemsToDraw ) )
134150
{
135151
//get bounds of selected item
136152
QPolygonF itemBounds;

0 commit comments

Comments
 (0)
Please sign in to comment.