summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8f98763)
raw | patch | inline | side by side (parent: 8f98763)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 6 Dec 2008 01:20:12 +0000 (01:20 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sat, 6 Dec 2008 01:20:12 +0000 (01:20 +0000) |
src/pencil-context.cpp | patch | blob | history |
diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp
index 88fa3a2d477f50e100717e0d5c8bd0f37e53feee..a80f565faf4725ea5059647b311ae59ccc705cbd 100644 (file)
--- a/src/pencil-context.cpp
+++ b/src/pencil-context.cpp
guint n_points = pc->ps.size();
pc->green_curve->reset();
pc->red_curve->reset();
+ pc->red_curve_is_valid = false;
Geom::Point * b = g_new(Geom::Point, 4*n_points);
Geom::Point * points = g_new(Geom::Point, 4*n_points);
if ( n_segs > 0)
{
/* Fit and draw and reset state */
- pc->red_curve->reset();
- pc->red_curve->moveto(b[0]);
+ pc->green_curve->moveto(b[0]);
for (int c = 0; c < n_segs; c++) {
- pc->red_curve->curveto(b[4*c+1], b[4*c+2], b[4*c+3]);
+ pc->green_curve->curveto(b[4*c+1], b[4*c+2], b[4*c+3]);
}
- sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->red_curve);
- pc->red_curve_is_valid = true;
+ sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->green_curve);
/* Fit and draw and copy last point */
- g_assert(!pc->red_curve->is_empty());
+ g_assert(!pc->green_curve->is_empty());
/* Set up direction of next curve. */
{
- Geom::CubicBezier const * last_seg = dynamic_cast<Geom::CubicBezier const *>(pc->red_curve->last_segment());
+ Geom::CubicBezier const * last_seg = dynamic_cast<Geom::CubicBezier const *>(pc->green_curve->last_segment());
g_assert( last_seg ); // Relevance: validity of (*last_seg)[2]
pc->p[0] = last_seg->finalPoint();
pc->npoints = 1;
? Geom::Point(0, 0)
: Geom::unit_vector(req_vec) );
}
-
- pc->green_curve->append_continuous(pc->red_curve, 0.0625);
- SPCurve *curve = pc->red_curve->copy();
-
- /// \todo fixme:
- SPCanvasItem *cshape = sp_canvas_bpath_new(sp_desktop_sketch(pc->desktop), curve);
- curve->unref();
- sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(cshape), pc->green_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
-
- pc->green_bpaths = g_slist_prepend(pc->green_bpaths, cshape);
-
- pc->red_curve_is_valid = false;
}
g_free(b);
g_free(points);