*/
void update()
{
+ if( !vgHasContextSH() )
+ return;
+
if( _attributes_dirty & PATH )
{
const VGbitfield caps = VG_PATH_CAPABILITY_APPEND_TO
_path( new PathDrawable(this) )
{
setDrawable(_path);
- PathDrawable *path = _path.get();
- addStyle("fill", &PathDrawable::setFill, path);
- addStyle("fill-rule", &PathDrawable::setFillRule, path);
- addStyle("stroke", &PathDrawable::setStroke, path);
- addStyle("stroke-width", &PathDrawable::setStrokeWidth, path);
- addStyle("stroke-dasharray", &PathDrawable::setStrokeDashArray, path);
- addStyle("stroke-linecap", &PathDrawable::setStrokeLinecap, path);
+ if( !isInit<Path>() )
+ {
+ PathDrawableRef Path::*path = &Path::_path;
+
+ addStyle("fill", "color", &PathDrawable::setFill, path);
+ addStyle("fill-rule", "", &PathDrawable::setFillRule, path);
+ addStyle("stroke", "color", &PathDrawable::setStroke, path);
+ addStyle("stroke-width", "numeric", &PathDrawable::setStrokeWidth, path);
+ addStyle("stroke-dasharray", "", &PathDrawable::setStrokeDashArray, path);
+ addStyle("stroke-linecap", "", &PathDrawable::setStrokeLinecap, path);
+ }
setupStyle();
}
return _path->getTransformedBounds(m);
}
+ //----------------------------------------------------------------------------
+ Path& Path::moveTo(float x_abs, float y_abs)
+ {
+ return addSegment(VG_MOVE_TO_ABS, x_abs, y_abs);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::move(float x_rel, float y_rel)
+ {
+ return addSegment(VG_MOVE_TO_REL, x_rel, y_rel);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::lineTo(float x_abs, float y_abs)
+ {
+ return addSegment(VG_LINE_TO_ABS, x_abs, y_abs);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::line(float x_rel, float y_rel)
+ {
+ return addSegment(VG_LINE_TO_REL, x_rel, y_rel);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::horizTo(float x_abs)
+ {
+ return addSegment(VG_HLINE_TO_ABS, x_abs);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::horiz(float x_rel)
+ {
+ return addSegment(VG_HLINE_TO_REL, x_rel);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::vertTo(float y_abs)
+ {
+ return addSegment(VG_VLINE_TO_ABS, y_abs);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::vert(float y_rel)
+ {
+ return addSegment(VG_VLINE_TO_REL, y_rel);
+ }
+
+ //----------------------------------------------------------------------------
+ Path& Path::close()
+ {
+ return addSegment(VG_CLOSE_PATH);
+ }
+
//----------------------------------------------------------------------------
void Path::childRemoved(SGPropertyNode* child)
{