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@7449 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Nov 18, 2007
1 parent 2bec93e commit c0c301319fd192c4ea9bae31e05807ff38c9340c
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 c0c3013

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