File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -525,7 +525,13 @@ void QgsComposerItem::drawSelectionBoxes( QPainter* p )
525
525
selectedItemPen.setWidth ( 0 );
526
526
p->setPen ( selectedItemPen );
527
527
p->setBrush ( Qt::NoBrush );
528
- p->drawPolygon ( rect () );
528
+
529
+ // drawPolygon causes issues on windows - corners of path may be missing resulting in triangles being drawn
530
+ // instead of rectangles! (Same cause as #13343)
531
+ QPainterPath path;
532
+ path.addPolygon ( rect () );
533
+ p->drawPath ( path );
534
+
529
535
p->restore ();
530
536
}
531
537
Original file line number Diff line number Diff line change @@ -291,6 +291,11 @@ void QgsPanningWidget::setPolygon( const QPolygon& p )
291
291
{
292
292
if ( p == mPoly ) return ;
293
293
mPoly = p;
294
+
295
+ // ensure polygon is closed
296
+ if ( mPoly .at ( 0 ) != mPoly .at ( mPoly .length () - 1 ) )
297
+ mPoly .append ( mPoly .at ( 0 ) );
298
+
294
299
setGeometry ( p.boundingRect () );
295
300
update ();
296
301
}
@@ -303,7 +308,13 @@ void QgsPanningWidget::paintEvent( QPaintEvent* pe )
303
308
p.begin ( this );
304
309
p.setPen ( Qt::red );
305
310
QPolygonF t = mPoly .translated ( -mPoly .boundingRect ().left (), -mPoly .boundingRect ().top () );
306
- p.drawConvexPolygon ( t );
311
+
312
+ // drawPolygon causes issues on windows - corners of path may be missing resulting in triangles being drawn
313
+ // instead of rectangles! (Same cause as #13343)
314
+ QPainterPath path;
315
+ path.addPolygon ( t );
316
+ p.drawPath ( path );
317
+
307
318
p.end ();
308
319
}
309
320
You can’t perform that action at this time.
0 commit comments