Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Limit scale bar with
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7992 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 17, 2008
1 parent bbe6908 commit 105b3c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/gui/qgsquickprint.cpp
Expand Up @@ -615,7 +615,7 @@ void QgsQuickPrint::printMap()
//
// Draw the scale bar
//
renderPrintScaleBar(&myPrintPainter, mpMapCanvas);
renderPrintScaleBar(&myPrintPainter, mpMapCanvas, myLogoXDim);

//
// Finish up
Expand Down Expand 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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/gui/qgsquickprint.h
Expand Up @@ -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
Expand Down

0 comments on commit 105b3c2

Please sign in to comment.