Skip to content
Permalink
Browse files
Limit scale bar with
git-svn-id: http://svn.osgeo.org/qgis/trunk@7992 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 17, 2008
1 parent 7c346d9 commit 5f1c0cba8a33cbee8f7243fee6248a65d499bfab
Showing with 8 additions and 4 deletions.
  1. +5 −3 src/gui/qgsquickprint.cpp
  2. +3 −1 src/gui/qgsquickprint.h
@@ -615,7 +615,7 @@ void QgsQuickPrint::printMap()
//
// Draw the scale bar
//
renderPrintScaleBar(&myPrintPainter, mpMapCanvas);
renderPrintScaleBar(&myPrintPainter, mpMapCanvas, myLogoXDim);

//
// Finish up
@@ -743,7 +743,9 @@ void QgsQuickPrint::scalePointSymbols( int theScaleFactor, SymbolScalingType the



void QgsQuickPrint::renderPrintScaleBar(QPainter * thepPainter, QgsMapCanvas * thepMapCanvas)
void QgsQuickPrint::renderPrintScaleBar(QPainter * thepPainter,
QgsMapCanvas * thepMapCanvas,
int theMaximumWidth)
{
//hard coding some options for now
int myStyleIndex = 1; //tick up
@@ -757,7 +759,7 @@ void QgsQuickPrint::renderPrintScaleBar(QPainter * thepPainter, QgsMapCanvas * t
int myXMargin=260;
int myYMargin=180;
int myCanvasWidth = thepMapCanvas->width();
int myPreferredSize = myCanvasWidth;
int myPreferredSize = theMaximumWidth;
double myActualSize=myPreferredSize;
int myBufferSize=1; //softcode this later
QColor myBackColor = Qt::white; //used for text
@@ -53,7 +53,9 @@ public slots:
void setOutputPdf(QString theFileName);
void setMapCanvas(QgsMapCanvas * thepMapCanvas);
private:
void renderPrintScaleBar(QPainter * thepPainter, QgsMapCanvas * thepMapCanvas);
void renderPrintScaleBar(QPainter * thepPainter,
QgsMapCanvas * thepMapCanvas,
int theMaximumWidth);
/**
* Scale symbols in all layers by the specified amount.
* Typically used for printing. Each symbol in

0 comments on commit 5f1c0cb

Please sign in to comment.