@@ -775,6 +775,7 @@ void QgsLayoutItemMapGrid::drawGridFrameBorder( QPainter *p, const QMap< double,
775
775
switch ( mGridFrameStyle )
776
776
{
777
777
case QgsLayoutItemMapGrid::Zebra:
778
+ case QgsLayoutItemMapGrid::ZebraNautical:
778
779
drawGridFrameZebraBorder ( p, borderPos, border, extension );
779
780
break ;
780
781
case QgsLayoutItemMapGrid::InteriorTicks:
@@ -871,13 +872,17 @@ void QgsLayoutItemMapGrid::drawGridFrameZebraBorder( QPainter *p, const QMap< do
871
872
currentCoord = posIt.key ();
872
873
color1 = !color1;
873
874
}
874
- // draw corners
875
- width = height = ( mGridFrameWidth + mGridFrameMargin ) ;
876
- p->setBrush ( QBrush ( mGridFrameFillColor1 ) );
877
- p->drawRect ( QRectF ( -( mGridFrameWidth + mGridFrameMargin ), -( mGridFrameWidth + mGridFrameMargin ), width, height ) );
878
- p->drawRect ( QRectF ( mMap ->rect ().width (), -( mGridFrameWidth + mGridFrameMargin ), width, height ) );
879
- p->drawRect ( QRectF ( -( mGridFrameWidth + mGridFrameMargin ), mMap ->rect ().height (), width, height ) );
880
- p->drawRect ( QRectF ( mMap ->rect ().width (), mMap ->rect ().height (), width, height ) );
875
+
876
+ if ( mGridFrameStyle == ZebraNautical )
877
+ {
878
+ // draw corners
879
+ width = height = ( mGridFrameWidth + mGridFrameMargin ) ;
880
+ p->setBrush ( QBrush ( mGridFrameFillColor1 ) );
881
+ p->drawRect ( QRectF ( -( mGridFrameWidth + mGridFrameMargin ), -( mGridFrameWidth + mGridFrameMargin ), width, height ) );
882
+ p->drawRect ( QRectF ( mMap ->rect ().width (), -( mGridFrameWidth + mGridFrameMargin ), width, height ) );
883
+ p->drawRect ( QRectF ( -( mGridFrameWidth + mGridFrameMargin ), mMap ->rect ().height (), width, height ) );
884
+ p->drawRect ( QRectF ( mMap ->rect ().width (), mMap ->rect ().height (), width, height ) );
885
+ }
881
886
}
882
887
883
888
void QgsLayoutItemMapGrid::drawGridFrameTicks ( QPainter *p, const QMap< double , double > &borderPos, QgsLayoutItemMapGrid::BorderSide border, double *extension ) const
@@ -1067,6 +1072,7 @@ void QgsLayoutItemMapGrid::drawCoordinateAnnotation( QPainter *p, QPointF pos, c
1067
1072
break ;
1068
1073
1069
1074
case QgsLayoutItemMapGrid::Zebra:
1075
+ case QgsLayoutItemMapGrid::ZebraNautical:
1070
1076
case QgsLayoutItemMapGrid::LineBorder:
1071
1077
case QgsLayoutItemMapGrid::LineBorderNautical:
1072
1078
gridFrameDistance += ( mGridFramePenThickness / 2.0 );
@@ -1091,7 +1097,7 @@ void QgsLayoutItemMapGrid::drawCoordinateAnnotation( QPainter *p, QPointF pos, c
1091
1097
1092
1098
if ( mLeftGridAnnotationPosition == QgsLayoutItemMapGrid::InsideMapFrame )
1093
1099
{
1094
- if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ExteriorTicks )
1100
+ if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ZebraNautical || mGridFrameStyle == QgsLayoutItemMapGrid:: ExteriorTicks )
1095
1101
{
1096
1102
gridFrameDistance = 0 ;
1097
1103
}
@@ -1163,7 +1169,7 @@ void QgsLayoutItemMapGrid::drawCoordinateAnnotation( QPainter *p, QPointF pos, c
1163
1169
1164
1170
if ( mRightGridAnnotationPosition == QgsLayoutItemMapGrid::InsideMapFrame )
1165
1171
{
1166
- if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ExteriorTicks )
1172
+ if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ZebraNautical || mGridFrameStyle == QgsLayoutItemMapGrid:: ExteriorTicks )
1167
1173
{
1168
1174
gridFrameDistance = 0 ;
1169
1175
}
@@ -1235,7 +1241,7 @@ void QgsLayoutItemMapGrid::drawCoordinateAnnotation( QPainter *p, QPointF pos, c
1235
1241
1236
1242
if ( mBottomGridAnnotationPosition == QgsLayoutItemMapGrid::InsideMapFrame )
1237
1243
{
1238
- if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ExteriorTicks )
1244
+ if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ZebraNautical || mGridFrameStyle == QgsLayoutItemMapGrid:: ExteriorTicks )
1239
1245
{
1240
1246
gridFrameDistance = 0 ;
1241
1247
}
@@ -1311,7 +1317,7 @@ void QgsLayoutItemMapGrid::drawCoordinateAnnotation( QPainter *p, QPointF pos, c
1311
1317
1312
1318
if ( mTopGridAnnotationPosition == QgsLayoutItemMapGrid::InsideMapFrame )
1313
1319
{
1314
- if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ExteriorTicks )
1320
+ if ( mGridFrameStyle == QgsLayoutItemMapGrid::Zebra || mGridFrameStyle == QgsLayoutItemMapGrid::ZebraNautical || mGridFrameStyle == QgsLayoutItemMapGrid:: ExteriorTicks )
1315
1321
{
1316
1322
gridFrameDistance = 0 ;
1317
1323
}
0 commit comments