Skip to content

Commit

Permalink
Limit scale bar with
Browse files Browse the repository at this point in the history
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 5f1c0cb
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 5f1c0cb

Please sign in to comment.