Skip to content

Commit 5f557ef

Browse files
author
g_j_m
committed
- Fix the bug where setting the outline thickness of polygons
didn't work with a continuous renderer. - Only show the 'draw polygon outline' check box when the layer type is polygon - Allow a outline thickness of 0 (gives a 1 pixel line) git-svn-id: http://svn.osgeo.org/qgis/trunk@5824 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 2c8c195 commit 5f557ef

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/gui/qgscontinuouscolordialog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog(QgsVectorLayer * layer)
8484
lblMinValue->setPaletteBackgroundColor(minsymbol->brush().color());
8585
lblMaxValue->setPaletteBackgroundColor(maxsymbol->brush().color());
8686
}
87-
outlinewidthspinbox->setMinValue(1);
87+
outlinewidthspinbox->setMinValue(0);
8888
outlinewidthspinbox->setValue(minsymbol->pen().width());
8989

9090
if (renderer->drawPolygonOutline())
@@ -96,6 +96,8 @@ QgsContinuousColorDialog::QgsContinuousColorDialog(QgsVectorLayer * layer)
9696
{
9797
cb_polygonOutline->setCheckState(Qt::Checked);
9898
outlinewidthspinbox->setValue(1);
99+
if (mVectorLayer->vectorType() != QGis::Polygon)
100+
cb_polygonOutline->setVisible(false);
99101
}
100102
// Ensure that the state of other widgets is appropriate for the
101103
// state of the polygonoutline checkbox.

src/gui/qgscontinuouscolorrenderer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ void QgsContinuousColorRenderer::renderFeature(QPainter * p, QgsFeature * f, QPi
152152
{
153153
p->setBrush(QColor(red, green, blue));
154154
if (mDrawPolygonOutline)
155-
p->setPen(QColor(0, 0, 0));
155+
{
156+
QPen pen;
157+
pen.setColor(QColor(0,0,0));
158+
pen.setWidthF(widthScale*mMinimumSymbol->pen().width());
159+
p->setPen(pen);
160+
}
156161
else
157162
p->setPen(Qt::NoPen);
158163
}

0 commit comments

Comments
 (0)