summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4fa3e23)
raw | patch | inline | side by side (parent: 4fa3e23)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 6 Aug 2008 05:20:51 +0000 (05:20 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 6 Aug 2008 05:20:51 +0000 (05:20 +0000) |
src/display/canvas-bpath.cpp | patch | blob | history | |
src/display/canvas-bpath.h | patch | blob | history |
index 15acece5e403791fba7e227c9483aafbf7a7c1b9..5f1262ced61a726eb6a30869da20e77d5c42ad8a 100644 (file)
// RGB / BGR
cairo_set_source_rgba(buf->ct, SP_RGBA32_B_F(cbp->stroke_rgba), SP_RGBA32_G_F(cbp->stroke_rgba), SP_RGBA32_R_F(cbp->stroke_rgba), SP_RGBA32_A_F(cbp->stroke_rgba));
cairo_set_line_width(buf->ct, 1);
+ if (cbp->dashes[0] != 0 && cbp->dashes[1] != 0) {
+ cairo_set_dash (buf->ct, cbp->dashes, 2, 0);
+ }
cairo_stroke(buf->ct);
}
}
}
void
-sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap)
+sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap, double dash, double gap)
{
g_return_if_fail (cbp != NULL);
g_return_if_fail (SP_IS_CANVAS_BPATH (cbp));
@@ -276,6 +279,8 @@ sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPS
cbp->stroke_width = MAX (width, 0.1);
cbp->stroke_linejoin = join;
cbp->stroke_linecap = cap;
+ cbp->dashes[0] = dash;
+ cbp->dashes[1] = gap;
sp_canvas_item_request_update (SP_CANVAS_ITEM (cbp));
}
index bc3db883b85e85bbe3c074e9b99aa49bd4f5f3d5..d6382b65145655b117b7771158eb4a78cfd5c457 100644 (file)
/* Line attributes */
guint32 stroke_rgba;
gdouble stroke_width;
+ gdouble dashes[2];
SPStrokeJoinType stroke_linejoin;
SPStrokeCapType stroke_linecap;
gdouble stroke_miterlimit;
void sp_canvas_bpath_set_bpath (SPCanvasBPath *cbp, SPCurve *curve);
void sp_canvas_bpath_set_fill (SPCanvasBPath *cbp, guint32 rgba, SPWindRule rule);
-void sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap);
+void sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap, double dash=0, double gap=0);
/*