Skip to content
Permalink
Browse files

Fixed #2379 - hang on line width set to zero (division by zero)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12803 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jan 20, 2010
1 parent 2ac34fd commit e615bcd86990d92436459ca58466f4eceabaa19a
Showing with 3 additions and 18 deletions.
  1. +2 −10 src/core/symbology-ng/qgslinesymbollayerv2.cpp
  2. +1 −8 src/gui/symbology-ng/qgssymbollayerv2widget.cpp
@@ -56,13 +56,12 @@ QString QgsSimpleLineSymbolLayerV2::layerType() const
return "SimpleLine";
}


void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
{
mPen.setColor( mColor );
double scaledWidth = context.outputLineWidth( mWidth );
mPen.setWidthF( scaledWidth );
if ( mUseCustomDashPattern )
if ( mUseCustomDashPattern && scaledWidth != 0 )
{
mPen.setStyle( Qt::CustomDashLine );

@@ -116,14 +115,7 @@ QgsStringMap QgsSimpleLineSymbolLayerV2::properties() const
map["joinstyle"] = QgsSymbolLayerV2Utils::encodePenJoinStyle( mPenJoinStyle );
map["capstyle"] = QgsSymbolLayerV2Utils::encodePenCapStyle( mPenCapStyle );
map["offset"] = QString::number( mOffset );
if ( mUseCustomDashPattern )
{
map["use_custom_dash"] = "1";
}
else
{
map["use_custom_dash"] = "0";
}
map["use_custom_dash"] = ( mUseCustomDashPattern ? "1" : "0" );
map["customdash"] = QgsSymbolLayerV2Utils::encodeRealVector( mCustomDashVector );
return map;
}
@@ -59,14 +59,7 @@ void QgsSimpleLineSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
label_3->setEnabled( !useCustomDashPattern );
cboPenStyle->setEnabled( !useCustomDashPattern );
mCustomCheckBox->blockSignals( true );
if ( useCustomDashPattern )
{
mCustomCheckBox->setCheckState( Qt::Checked );
}
else
{
mCustomCheckBox->setCheckState( Qt::Unchecked );
}
mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
mCustomCheckBox->blockSignals( false );
updatePatternIcon();
}

0 comments on commit e615bcd

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