Skip to content

Commit 68f7d57

Browse files
committedNov 1, 2011
Improve vector field widget
1 parent 59545f1 commit 68f7d57

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
 

‎src/core/symbology-ng/qgsvectorfieldsymbollayer.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ void QgsVectorFieldSymbolLayer::renderPoint( const QPointF& point, QgsSymbolV2Re
109109
convertPolarToCartesian( xVal, yVal, xComponent, yComponent );
110110
xComponent = context.outputLineWidth( xComponent );
111111
yComponent = context.outputLineWidth( yComponent );
112+
break;
112113
case Height:
113114
xComponent = 0;
114115
yComponent = context.outputLineWidth( yVal );
116+
break;
115117
default:
116118
break;
117119
}

‎src/gui/symbology-ng/qgsvectorfieldsymbollayerwidget.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ void QgsVectorFieldSymbolLayerWidget::on_mCartesianRadioButton_toggled( bool che
140140
if ( mLayer && checked )
141141
{
142142
mLayer->setVectorFieldType( QgsVectorFieldSymbolLayer::Cartesian );
143+
mXAttributeComboBox->setEnabled( true );
144+
mYAttributeComboBox->setEnabled( true );
145+
mXAttributeLabel->setText( tr( "X attribute" ) );
146+
mYAttributeLabel->setText( tr( "Y attribute" ) );
143147
emit changed();
144148
}
145149
}
@@ -149,6 +153,10 @@ void QgsVectorFieldSymbolLayerWidget::on_mPolarRadioButton_toggled( bool checked
149153
if ( mLayer && checked )
150154
{
151155
mLayer->setVectorFieldType( QgsVectorFieldSymbolLayer::Polar );
156+
mXAttributeComboBox->setEnabled( true );
157+
mYAttributeComboBox->setEnabled( true );
158+
mXAttributeLabel->setText( tr( "Length attribute" ) );
159+
mYAttributeLabel->setText( tr( "Angle attribute" ) );
152160
emit changed();
153161
}
154162
}
@@ -158,6 +166,9 @@ void QgsVectorFieldSymbolLayerWidget::on_mHeightRadioButton_toggled( bool checke
158166
if ( mLayer && checked )
159167
{
160168
mLayer->setVectorFieldType( QgsVectorFieldSymbolLayer::Height );
169+
mXAttributeLabel->setText( "" );
170+
mXAttributeComboBox->setEnabled( false );
171+
mYAttributeLabel->setText( tr( "Height attribute" ) );
161172
emit changed();
162173
}
163174
}

‎src/ui/symbollayer/widget_vectorfield.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<item row="1" column="0">
2828
<widget class="QLabel" name="mYAttributeLabel">
2929
<property name="text">
30-
<string>Y Attribute</string>
30+
<string>Y attribute</string>
3131
</property>
3232
</widget>
3333
</item>

0 commit comments

Comments
 (0)
Please sign in to comment.