Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added transparency support for lines too
git-svn-id: http://svn.osgeo.org/qgis/trunk@4712 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 21, 2006
1 parent 388e266 commit 706947e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gui/qgsvectorlayer.cpp
Expand Up @@ -526,7 +526,20 @@ unsigned char* QgsVectorLayer::drawLineString(unsigned char* feature,

// The default pen gives bevelled joins between segements of the
// polyline, which is good enough for the moment.
//preserve a copy of the pen before we start fiddling with it
QPen pen = p->pen(); // to be kept original
//
// experimental alpha transparency
// 255 = opaque
//
QPen myTransparentPen = p->pen(); // store current pen
QColor myColor = myTransparentPen.color();
myColor.setAlpha(transparencyLevelInt);
myTransparentPen.setColor(myColor);
p->setPen(myTransparentPen);
p->drawPolyline(pa);
//restore the pen
p->setPen(pen);

return ptr;
}
Expand Down

0 comments on commit 706947e

Please sign in to comment.