_mode(0),
_fill_rule(VG_EVEN_ODD),
_stroke_width(1),
- _stroke_linecap(VG_CAP_BUTT)
+ _stroke_linecap(VG_CAP_BUTT),
+ _stroke_linejoin(VG_JOIN_MITER)
{
setSupportsDisplayList(false);
setDataVariance(Object::DYNAMIC);
_stroke_linecap = VG_CAP_BUTT;
}
+ /**
+ * Set stroke-linejoin
+ *
+ * @see http://www.w3.org/TR/SVG/painting.html#StrokeLinejoinProperty
+ */
+ void setStrokeLinejoin(const std::string& linejoin)
+ {
+ if( linejoin == "round" )
+ _stroke_linejoin = VG_JOIN_ROUND;
+ else if( linejoin == "bevel" )
+ _stroke_linejoin = VG_JOIN_BEVEL;
+ else
+ _stroke_linejoin = VG_JOIN_MITER;
+ }
+
/**
* Draw callback
*/
vgSetf(VG_STROKE_LINE_WIDTH, _stroke_width);
vgSeti(VG_STROKE_CAP_STYLE, _stroke_linecap);
+ vgSeti(VG_STROKE_JOIN_STYLE, _stroke_linejoin);
vgSetfv( VG_STROKE_DASH_PATTERN,
_stroke_dash.size(),
_stroke_dash.empty() ? 0 : &_stroke_dash[0] );
VGfloat _stroke_width;
std::vector<VGfloat> _stroke_dash;
VGCapStyle _stroke_linecap;
+ VGJoinStyle _stroke_linejoin;
osg::Vec3f transformPoint( const osg::Matrix& m,
osg::Vec2f pos ) const
addStyle("stroke-width", "numeric", &PathDrawable::setStrokeWidth, path);
addStyle("stroke-dasharray", "", &PathDrawable::setStrokeDashArray, path);
addStyle("stroke-linecap", "", &PathDrawable::setStrokeLinecap, path);
+ addStyle("stroke-linejoin", "", &PathDrawable::setStrokeLinejoin, path);
}
//----------------------------------------------------------------------------