Skip to content

Commit

Permalink
added horizontal positioning for line features
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@11049 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jul 12, 2009
1 parent 6d00c9a commit 5619ba7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
9 changes: 5 additions & 4 deletions src/core/pal/feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions src/plugins/labeling/labelinggui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/labeling/labelingguibase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 5619ba7

Please sign in to comment.