[QGIS Commit] r11049 - in branches/symbology-ng-branch/src:
core/pal plugins/labeling
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Jul 12 08:15:02 EDT 2009
Author: wonder
Date: 2009-07-12 08:15:01 -0400 (Sun, 12 Jul 2009)
New Revision: 11049
Modified:
branches/symbology-ng-branch/src/core/pal/feature.cpp
branches/symbology-ng-branch/src/plugins/labeling/labelinggui.cpp
branches/symbology-ng-branch/src/plugins/labeling/labelingguibase.ui
Log:
added horizontal positioning for line features
Modified: branches/symbology-ng-branch/src/core/pal/feature.cpp
===================================================================
--- branches/symbology-ng-branch/src/core/pal/feature.cpp 2009-07-12 09:29:45 UTC (rev 11048)
+++ branches/symbology-ng-branch/src/core/pal/feature.cpp 2009-07-12 12:15:01 UTC (rev 11049)
@@ -481,10 +481,11 @@
positions->push_back( new LabelPosition( i, bx + cos( beta ) *distlabel , by + sin( beta ) *distlabel, xrm, yrm, alpha, cost, this ) ); // Line
positions->push_back( new LabelPosition( i, bx - cos( beta ) * ( distlabel + yrm ) , by - sin( beta ) * ( distlabel + yrm ), xrm, yrm, alpha, cost, this ) ); // Line
}
- /*else if (layer->arrangement == P_HORIZ){ // TODO add P_HORIZ
- positions->push_back (new LabelPosition (i, bx -yrm/2, by - yrm*sin(beta)/2, xrm, yrm, alpha, cost, this, line)); // Line
- line->aliveCandidates++;
- }*/
+ else if (layer->arrangement == P_HORIZ)
+ {
+ positions->push_back( new LabelPosition(i, bx - xrm/2, by - yrm/2, xrm, yrm, 0, cost, this) ); // Line
+ //positions->push_back( new LabelPosition(i, bx -yrm/2, by - yrm*sin(beta)/2, xrm, yrm, alpha, cost, this, line)); // Line
+ }
else
{
positions->push_back( new LabelPosition( i, bx - yrm*cos( beta ) / 2, by - yrm*sin( beta ) / 2, xrm, yrm, alpha, cost, this ) ); // Line
Modified: branches/symbology-ng-branch/src/plugins/labeling/labelinggui.cpp
===================================================================
--- branches/symbology-ng-branch/src/plugins/labeling/labelinggui.cpp 2009-07-12 09:29:45 UTC (rev 11048)
+++ branches/symbology-ng-branch/src/plugins/labeling/labelinggui.cpp 2009-07-12 12:15:01 UTC (rev 11049)
@@ -94,6 +94,7 @@
break;
case LayerSettings::Horizontal:
radPolygonHorizontal->setChecked(true);
+ radLineHorizontal->setChecked(true);
break;
case LayerSettings::Free:
radPolygonFree->setChecked(true);
@@ -190,16 +191,17 @@
else
lyr.placement = LayerSettings::OnLine;
}
- else
+ else if ( (stackedPlacement->currentWidget() == pageLine && radLineHorizontal->isChecked())
+ || (stackedPlacement->currentWidget() == pagePolygon && radPolygonHorizontal->isChecked()) )
{
- // this must be polygon - horizontal / free
- if (radPolygonHorizontal->isChecked())
lyr.placement = LayerSettings::Horizontal;
- else if (radPolygonFree->isChecked())
- lyr.placement = LayerSettings::Free;
- else
- Q_ASSERT(0 && "NOOO!");
}
+ else if (radPolygonFree->isChecked())
+ {
+ lyr.placement = LayerSettings::Free;
+ }
+ else
+ Q_ASSERT(0 && "NOOO!");
lyr.textColor = btnTextColor->color();
Modified: branches/symbology-ng-branch/src/plugins/labeling/labelingguibase.ui
===================================================================
--- branches/symbology-ng-branch/src/plugins/labeling/labelingguibase.ui 2009-07-12 09:29:45 UTC (rev 11048)
+++ branches/symbology-ng-branch/src/plugins/labeling/labelingguibase.ui 2009-07-12 12:15:01 UTC (rev 11049)
@@ -77,7 +77,7 @@
<item>
<widget class="QStackedWidget" name="stackedPlacement">
<property name="currentIndex">
- <number>2</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="pagePoint">
<layout class="QVBoxLayout" name="verticalLayout_2">
@@ -114,9 +114,6 @@
</item>
<item>
<widget class="QRadioButton" name="radLineHorizontal">
- <property name="enabled">
- <bool>false</bool>
- </property>
<property name="text">
<string>horizontal</string>
</property>
More information about the QGIS-commit
mailing list