Skip to content
Permalink
Browse files

added horizontal positioning for line features

git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@11049 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jul 12, 2009
1 parent 6d00c9a commit 5619ba793f786f1401fb05713775229a5ffd7eec
Showing with 15 additions and 15 deletions.
  1. +5 −4 src/core/pal/feature.cpp
  2. +9 −7 src/plugins/labeling/labelinggui.cpp
  3. +1 −4 src/plugins/labeling/labelingguibase.ui
@@ -481,10 +481,11 @@ namespace pal
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
@@ -94,6 +94,7 @@ LabelingGui::LabelingGui( PalLabeling* lbl, QString layerId, QWidget* parent )
break;
case LayerSettings::Horizontal:
radPolygonHorizontal->setChecked(true);
radLineHorizontal->setChecked(true);
break;
case LayerSettings::Free:
radPolygonFree->setChecked(true);
@@ -190,16 +191,17 @@ LayerSettings LabelingGui::layerSettings()
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();
@@ -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>

0 comments on commit 5619ba7

Please sign in to comment.
You can’t perform that action at this time.