[QGIS Commit] r8803 - branches/advanced_printing_branch/src/app/composer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Jul 17 06:54:45 EDT 2008


Author: mhugent
Date: 2008-07-17 06:54:44 -0400 (Thu, 17 Jul 2008)
New Revision: 8803

Modified:
   branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposerlegend.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposerscalebar.cpp
   branches/advanced_printing_branch/src/app/composer/qgscomposerscalebarwidget.cpp
   branches/advanced_printing_branch/src/app/composer/qgsticksmiddlescalebarstyle.cpp
Log:
Renamed scale bar style

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp	2008-07-17 09:46:20 UTC (rev 8802)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerlabel.cpp	2008-07-17 10:54:44 UTC (rev 8803)
@@ -20,6 +20,7 @@
 
 QgsComposerLabel::QgsComposerLabel( QgsComposition *composition): QgsComposerItem(composition), mMargin(0.0)
 {
+  mFont.setPointSizeF(3);
 }
 
 QgsComposerLabel::~QgsComposerLabel()
@@ -36,7 +37,7 @@
   painter->setFont(mFont);
 
   QFontMetricsF fontSize(mFont);
-  painter->drawText(mMargin, mMargin + fontSize.height(), mText);
+  painter->drawText(QPointF(mMargin, mMargin + fontSize.ascent()), mText);
 
   drawFrame(painter);
   if(isSelected())

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerlegend.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerlegend.cpp	2008-07-17 09:46:20 UTC (rev 8802)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerlegend.cpp	2008-07-17 10:54:44 UTC (rev 8803)
@@ -203,7 +203,7 @@
       //finally draw text
       if(p)
 	{
-	  p->drawText(QPointF(currentXCoord, currentYCoord + itemFontMetrics.height()), currentItem->text());
+	  p->drawText(QPointF(currentXCoord, currentYCoord + itemFontMetrics.ascent()), currentItem->text());
 	}
       
       maxXCoord = std::max(maxXCoord, currentXCoord + itemFontMetrics.width(currentItem->text()) + mBoxSpace);

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerscalebar.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerscalebar.cpp	2008-07-17 09:46:20 UTC (rev 8802)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerscalebar.cpp	2008-07-17 10:54:44 UTC (rev 8803)
@@ -202,7 +202,7 @@
     {
       mStyle = new QgsDoubleBoxScaleBarStyle(this);
     }
-  else if(styleName == tr("Bar Ticks Middle"))
+  else if(styleName == tr("Line Ticks Middle"))
     {
       mStyle = new QgsTicksMiddleScaleBarStyle(this);
     } 

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposerscalebarwidget.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposerscalebarwidget.cpp	2008-07-17 09:46:20 UTC (rev 8802)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposerscalebarwidget.cpp	2008-07-17 10:54:44 UTC (rev 8803)
@@ -27,7 +27,7 @@
 
   mStyleComboBox->insertItem(0, tr("Single Box"));
   mStyleComboBox->insertItem(1, tr("Double Box"));
-  mStyleComboBox->insertItem(2, tr("Bar Ticks Middle"));
+  mStyleComboBox->insertItem(2, tr("Line Ticks Middle"));
   mStyleComboBox->insertItem(3, tr("Numeric"));
 
   setGuiElements(); //set the GUI elements to the state of scaleBar

Modified: branches/advanced_printing_branch/src/app/composer/qgsticksmiddlescalebarstyle.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgsticksmiddlescalebarstyle.cpp	2008-07-17 09:46:20 UTC (rev 8802)
+++ branches/advanced_printing_branch/src/app/composer/qgsticksmiddlescalebarstyle.cpp	2008-07-17 10:54:44 UTC (rev 8803)
@@ -35,7 +35,7 @@
 
 QString QgsTicksMiddleScaleBarStyle::name() const
 {
-  return "Bar Ticks Middle";
+  return "Line Ticks Middle";
 }
 
 void QgsTicksMiddleScaleBarStyle::draw(QPainter* p) const
@@ -57,7 +57,7 @@
   for(; segmentIt != segmentInfo.constEnd(); ++segmentIt)
     {
       p->drawLine(segmentIt->first, barTopPosition, segmentIt->first, barTopPosition + mScaleBar->height());
-      p->drawLine(segmentIt->first, middlePosition,  + segmentIt->first + mScaleBar->segmentMM(), middlePosition); 
+      p->drawLine(segmentIt->first, middlePosition, segmentIt->first + mScaleBar->segmentMM(), middlePosition); 
     }
 
   //draw last tick



More information about the QGIS-commit mailing list