Skip to content

Commit a9f4596

Browse files
committed
[composer] Set initial background colour on map items to canvas background color (fix #3811)
1 parent dba34c3 commit a9f4596

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/core/composer/qgscomposermap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
8282
mGridAnnotationFont.setFamily( defaultFontString );
8383
}
8484

85+
//get the color for map canvas background and set map background color accordingly
86+
int bgRedInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorRedPart", 255 );
87+
int bgGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorGreenPart", 255 );
88+
int bgBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorBluePart", 255 );
89+
mBackgroundColor = QColor( bgRedInt, bgGreenInt, bgBlueInt );
90+
8591
connectUpdateSlot();
8692

8793
//calculate mExtent based on width/height ratio and map canvas extent

0 commit comments

Comments
 (0)