File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 25
25
#include " qgslayoutview.h"
26
26
#include " qgslayoutviewtoolselect.h"
27
27
#include " qgslayoutsnapper.h"
28
+ #include " qgslayoutitemgroup.h"
28
29
#include < QGraphicsView>
29
30
#include < QGraphicsSceneHoverEvent>
30
31
#include < QPainter>
@@ -130,7 +131,22 @@ void QgsLayoutMouseHandles::drawSelectedItemBounds( QPainter *painter )
130
131
painter->setPen ( selectedItemPen );
131
132
painter->setBrush ( Qt::NoBrush );
132
133
134
+ QList< QgsLayoutItem * > itemsToDraw;
133
135
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 ) )
134
150
{
135
151
// get bounds of selected item
136
152
QPolygonF itemBounds;
You can’t perform that action at this time.
0 commit comments