@@ -290,8 +290,6 @@ QgsPalLayerSettings::QgsPalLayerSettings()
290
290
mDataDefinedNames .insert ( Show, QPair<QString, int >( " Show" , 15 ) );
291
291
mDataDefinedNames .insert ( AlwaysShow, QPair<QString, int >( " AlwaysShow" , 20 ) );
292
292
293
- // temp stuff for when drawing label components (don't copy)
294
- showingShadowRects = false ;
295
293
}
296
294
297
295
QgsPalLayerSettings::QgsPalLayerSettings ( const QgsPalLayerSettings& s )
@@ -302,7 +300,6 @@ QgsPalLayerSettings::QgsPalLayerSettings( const QgsPalLayerSettings& s )
302
300
, mFeaturesToLabel( 0 )
303
301
, mFeatsSendingToPal( 0 )
304
302
, mFeatsRegPal( 0 )
305
- , showingShadowRects( false )
306
303
, expression( nullptr )
307
304
{
308
305
*this = s;
@@ -3983,16 +3980,6 @@ void QgsPalLabeling::setShowingCandidates( bool showing )
3983
3980
mEngine ->setFlag ( QgsLabelingEngine::DrawCandidates, showing );
3984
3981
}
3985
3982
3986
- bool QgsPalLabeling::isShowingShadowRectangles () const
3987
- {
3988
- return mEngine ->testFlag ( QgsLabelingEngine::DrawShadowRects );
3989
- }
3990
-
3991
- void QgsPalLabeling::setShowingShadowRectangles ( bool showing )
3992
- {
3993
- mEngine ->setFlag ( QgsLabelingEngine::DrawShadowRects, showing );
3994
- }
3995
-
3996
3983
bool QgsPalLabeling::isShowingAllLabels () const
3997
3984
{
3998
3985
return mEngine ->testFlag ( QgsLabelingEngine::UseAllLabels );
@@ -4510,19 +4497,18 @@ void QgsPalLabeling::drawLabelShadow( QgsRenderContext& context,
4510
4497
QgsSymbolLayerUtils::blurImageInPlace ( blurImg, blurImg.rect (), radius, shadow.blurAlphaOnly () );
4511
4498
}
4512
4499
4513
- if ( tmpLyr.showingShadowRects ) // engine setting, not per layer
4514
- {
4515
- // debug rect for QImage shadow registration and clipping visualization
4516
- QPainter picti;
4517
- picti.begin ( &blurImg );
4518
- picti.setBrush ( Qt::Dense7Pattern );
4519
- QPen imgPen ( QColor ( 0 , 0 , 255 , 255 ) );
4520
- imgPen.setWidth ( 1 );
4521
- picti.setPen ( imgPen );
4522
- picti.setOpacity ( 0.1 );
4523
- picti.drawRect ( 0 , 0 , blurImg.width (), blurImg.height () );
4524
- picti.end ();
4525
- }
4500
+ #if 0
4501
+ // debug rect for QImage shadow registration and clipping visualization
4502
+ QPainter picti;
4503
+ picti.begin( &blurImg );
4504
+ picti.setBrush( Qt::Dense7Pattern );
4505
+ QPen imgPen( QColor( 0, 0, 255, 255 ) );
4506
+ imgPen.setWidth( 1 );
4507
+ picti.setPen( imgPen );
4508
+ picti.setOpacity( 0.1 );
4509
+ picti.drawRect( 0, 0, blurImg.width(), blurImg.height() );
4510
+ picti.end();
4511
+ #endif
4526
4512
4527
4513
double offsetDist = QgsTextRenderer::scaleToPixelContext ( shadow.offsetDistance (), context,
4528
4514
shadow.offsetUnit (), true , shadow.offsetMapUnitScale () );
@@ -4562,39 +4548,38 @@ void QgsPalLabeling::drawLabelShadow( QgsRenderContext& context,
4562
4548
p->restore ();
4563
4549
4564
4550
// debug rects
4565
- if ( tmpLyr.showingShadowRects ) // engine setting, not per layer
4551
+ #if 0
4552
+ // draw debug rect for QImage painting registration
4553
+ p->save();
4554
+ p->setBrush( Qt::NoBrush );
4555
+ QPen imgPen( QColor( 255, 0, 0, 10 ) );
4556
+ imgPen.setWidth( 2 );
4557
+ imgPen.setStyle( Qt::DashLine );
4558
+ p->setPen( imgPen );
4559
+ p->scale( scale, scale );
4560
+ if ( component.useOrigin() )
4566
4561
{
4567
- // draw debug rect for QImage painting registration
4568
- p->save ();
4569
- p->setBrush ( Qt::NoBrush );
4570
- QPen imgPen ( QColor ( 255 , 0 , 0 , 10 ) );
4571
- imgPen.setWidth ( 2 );
4572
- imgPen.setStyle ( Qt::DashLine );
4573
- p->setPen ( imgPen );
4574
- p->scale ( scale, scale );
4575
- if ( component.useOrigin () )
4576
- {
4577
- p->translate ( component.origin ().x (), component.origin ().y () );
4578
- }
4579
- p->translate ( transPt );
4580
- p->translate ( -imgOffset.x (),
4581
- -imgOffset.y () );
4582
- p->drawRect ( 0 , 0 , blurImg.width (), blurImg.height () );
4583
- p->restore ();
4562
+ p->translate( component.origin().x(), component.origin().y() );
4563
+ }
4564
+ p->translate( transPt );
4565
+ p->translate( -imgOffset.x(),
4566
+ -imgOffset.y() );
4567
+ p->drawRect( 0, 0, blurImg.width(), blurImg.height() );
4568
+ p->restore();
4584
4569
4585
- // draw debug rect for passed in component dimensions
4586
- p->save ();
4587
- p->setBrush ( Qt::NoBrush );
4588
- QPen componentRectPen ( QColor ( 0 , 255 , 0 , 70 ) );
4589
- componentRectPen.setWidth ( 1 );
4590
- if ( component.useOrigin () )
4591
- {
4592
- p->translate ( component.origin ().x (), component.origin ().y () );
4593
- }
4594
- p->setPen ( componentRectPen );
4595
- p->drawRect ( QRect ( -xOffset, -componentHeight - yOffset, componentWidth, componentHeight ) );
4596
- p->restore ();
4570
+ // draw debug rect for passed in component dimensions
4571
+ p->save();
4572
+ p->setBrush( Qt::NoBrush );
4573
+ QPen componentRectPen( QColor( 0, 255, 0, 70 ) );
4574
+ componentRectPen.setWidth( 1 );
4575
+ if ( component.useOrigin() )
4576
+ {
4577
+ p->translate( component.origin().x(), component.origin().y() );
4597
4578
}
4579
+ p->setPen( componentRectPen );
4580
+ p->drawRect( QRect( -xOffset, -componentHeight - yOffset, componentWidth, componentHeight ) );
4581
+ p->restore();
4582
+ #endif
4598
4583
}
4599
4584
4600
4585
void QgsPalLabeling::loadEngineSettings ()
@@ -4614,7 +4599,6 @@ void QgsPalLabeling::clearEngineSettings()
4614
4599
QgsProject::instance ()->removeEntry ( " PAL" , " /CandidatesLine" );
4615
4600
QgsProject::instance ()->removeEntry ( " PAL" , " /CandidatesPolygon" );
4616
4601
QgsProject::instance ()->removeEntry ( " PAL" , " /ShowingCandidates" );
4617
- QgsProject::instance ()->removeEntry ( " PAL" , " /ShowingShadowRects" );
4618
4602
QgsProject::instance ()->removeEntry ( " PAL" , " /ShowingAllLabels" );
4619
4603
QgsProject::instance ()->removeEntry ( " PAL" , " /ShowingPartialsLabels" );
4620
4604
QgsProject::instance ()->removeEntry ( " PAL" , " /DrawOutlineLabels" );
@@ -4626,7 +4610,6 @@ QgsPalLabeling* QgsPalLabeling::clone()
4626
4610
lbl->setShowingAllLabels ( isShowingAllLabels () );
4627
4611
lbl->setShowingCandidates ( isShowingCandidates () );
4628
4612
lbl->setDrawLabelRectOnly ( drawLabelRectOnly () );
4629
- lbl->setShowingShadowRectangles ( isShowingShadowRectangles () );
4630
4613
lbl->setShowingPartialsLabels ( isShowingPartialsLabels () );
4631
4614
lbl->setDrawingOutlineLabels ( isDrawingOutlineLabels () );
4632
4615
return lbl;
0 commit comments