summaryrefslogtreecommitdiffstats
path: root/src/dyna-draw-context.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-17 22:00:40 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-17 22:00:40 +0000
commitb8d2a2d3b528d90cd88f96fd4a32b077c98776d5 (patch)
treeaa819f1acb877a25050e6dd559ba2b07daf69154 /src/dyna-draw-context.cpp
parentNR::Point : add cast operator to Geom::Point (diff)
downloadinkscape-b8d2a2d3b528d90cd88f96fd4a32b077c98776d5.tar.gz
inkscape-b8d2a2d3b528d90cd88f96fd4a32b077c98776d5.zip
convert all SPCurve's points and matrices arguments and return types to 2Geom
(bzr r6339)
Diffstat (limited to 'src/dyna-draw-context.cpp')
-rw-r--r--src/dyna-draw-context.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp
index e90a6143c..75250c604 100644
--- a/src/dyna-draw-context.cpp
+++ b/src/dyna-draw-context.cpp
@@ -194,11 +194,11 @@ sp_dyna_draw_context_setup(SPEventContext *ec)
if (((SPEventContextClass *) dd_parent_class)->setup)
((SPEventContextClass *) dd_parent_class)->setup(ec);
- ddc->accumulated = new SPCurve(32);
- ddc->currentcurve = new SPCurve(4);
+ ddc->accumulated = new SPCurve();
+ ddc->currentcurve = new SPCurve();
- ddc->cal1 = new SPCurve(32);
- ddc->cal2 = new SPCurve(32);
+ ddc->cal1 = new SPCurve();
+ ddc->cal2 = new SPCurve();
ddc->currentshape = sp_canvas_item_new(sp_desktop_sketch(ec->desktop), SP_TYPE_CANVAS_BPATH, NULL);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(ddc->currentshape), DDC_RED_RGBA, SP_WIND_RULE_EVENODD);
@@ -1021,7 +1021,7 @@ add_cap(SPCurve *curve,
double mag = NR::L2(vel);
NR::Point v = mag * NR::rot90( to - from ) / NR::L2( to - from );
- curve->curveto(from + v, to + v, to);
+ curve->curveto(to_2geom(from + v), to_2geom(to + v), to_2geom(to));
}
}
@@ -1121,8 +1121,8 @@ fit_and_split(SPDynaDrawContext *dc, gboolean release)
dc->cal1->reset();
dc->cal2->reset();
- dc->cal1->moveto(dc->point1[0]);
- dc->cal2->moveto(dc->point2[0]);
+ dc->cal1->moveto(to_2geom(dc->point1[0]));
+ dc->cal2->moveto(to_2geom(dc->point2[0]));
}
NR::Point b1[BEZIER_MAX_LENGTH];
@@ -1143,14 +1143,13 @@ fit_and_split(SPDynaDrawContext *dc, gboolean release)
/* CanvasShape */
if (! release) {
dc->currentcurve->reset();
- dc->currentcurve->moveto(b1[0]);
+ dc->currentcurve->moveto(to_2geom(b1[0]));
for (NR::Point *bp1 = b1; bp1 < b1 + BEZIER_SIZE * nb1; bp1 += BEZIER_SIZE) {
- dc->currentcurve->curveto(bp1[1],
- bp1[2], bp1[3]);
+ dc->currentcurve->curveto(to_2geom(bp1[1]), to_2geom(bp1[2]), to_2geom(bp1[3]));
}
dc->currentcurve->lineto(b2[BEZIER_SIZE*(nb2-1) + 3]);
for (NR::Point *bp2 = b2 + BEZIER_SIZE * ( nb2 - 1 ); bp2 >= b2; bp2 -= BEZIER_SIZE) {
- dc->currentcurve->curveto(bp2[2], bp2[1], bp2[0]);
+ dc->currentcurve->curveto(to_2geom(bp2[2]), to_2geom(bp2[1]), to_2geom(bp2[0]));
}
// FIXME: dc->segments is always NULL at this point??
if (!dc->segments) { // first segment