Skip to content

Commit

Permalink
- Fix the bug where setting the outline thickness of polygons
Browse files Browse the repository at this point in the history
  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/qgis@5824 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Sep 13, 2006
1 parent 6c6d9e6 commit c3cfef7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/gui/qgscontinuouscolordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog(QgsVectorLayer * layer)
lblMinValue->setPaletteBackgroundColor(minsymbol->brush().color());
lblMaxValue->setPaletteBackgroundColor(maxsymbol->brush().color());
}
outlinewidthspinbox->setMinValue(1);
outlinewidthspinbox->setMinValue(0);
outlinewidthspinbox->setValue(minsymbol->pen().width());

if (renderer->drawPolygonOutline())
Expand All @@ -96,6 +96,8 @@ QgsContinuousColorDialog::QgsContinuousColorDialog(QgsVectorLayer * layer)
{
cb_polygonOutline->setCheckState(Qt::Checked);
outlinewidthspinbox->setValue(1);
if (mVectorLayer->vectorType() != QGis::Polygon)
cb_polygonOutline->setVisible(false);
}
// Ensure that the state of other widgets is appropriate for the
// state of the polygonoutline checkbox.
Expand Down
7 changes: 6 additions & 1 deletion src/gui/qgscontinuouscolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ void QgsContinuousColorRenderer::renderFeature(QPainter * p, QgsFeature * f, QPi
{
p->setBrush(QColor(red, green, blue));
if (mDrawPolygonOutline)
p->setPen(QColor(0, 0, 0));
{
QPen pen;
pen.setColor(QColor(0,0,0));
pen.setWidthF(widthScale*mMinimumSymbol->pen().width());
p->setPen(pen);
}
else
p->setPen(Qt::NoPen);
}
Expand Down

0 comments on commit c3cfef7

Please sign in to comment.