Skip to content
Permalink
Browse files

Small bug fix - placing a scale bar on the map composer sometimes gives

a scalebar with 0 segments. This fixes that.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7449 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Nov 18, 2007
1 parent b9179b3 commit a094f316f3162d980ce6e7a7d42c454db2cb6e5d
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/composer/qgscomposerscalebar.cpp
@@ -80,7 +80,8 @@ QgsComposerScalebar::QgsComposerScalebar ( QgsComposition *composition, int id,
mSegmentLength = isize * powerOf10;

// the scale bar will take cca 1/4 of the map width
mNumSegments = (int) (mapwidth / 4 / mSegmentLength);
// But always have at least one segment.
mNumSegments = std::max(1, (int) (mapwidth / 4 / mSegmentLength));

int segsize = (int) (mSegmentLength * map->scale());

0 comments on commit a094f31

Please sign in to comment.
You can’t perform that action at this time.