summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 740473b)
raw | patch | inline | side by side (parent: 740473b)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 17 Jul 2008 22:00:40 +0000 (22:00 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 17 Jul 2008 22:00:40 +0000 (22:00 +0000) |
17 files changed:
diff --git a/src/box3d.cpp b/src/box3d.cpp
index cda482e738c3944c2a05044bcb594d4f5f5c36aa..3c972063dbefde6c0cfd1ce4d93abec94762f1b3 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
static inline void
box3d_push_back_corner_pair(SPBox3D *box, std::list<std::pair<Geom::Point, Geom::Point> > &pts, int c1, int c2) {
- pts.push_back(std::make_pair(box3d_get_corner_screen(box, c1, false).to_2geom(),
- box3d_get_corner_screen(box, c2, false).to_2geom()));
+ pts.push_back(std::make_pair(box3d_get_corner_screen(box, c1, false),
+ box3d_get_corner_screen(box, c2, false)));
}
void
index 99fcb6659d7fb112b166404e4e3e38b536b6b269..3d109a69c0ccdd328cc32beb837852c913a3c9df 100644 (file)
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(cc->red_bpath), 0x00000000,
SP_WIND_RULE_NONZERO);
/* Create red curve */
- cc->red_curve = new SPCurve(4);
+ cc->red_curve = new SPCurve();
/* Create green curve */
- cc->green_curve = new SPCurve(64);
+ cc->green_curve = new SPCurve();
// Notice the initial selection.
cc_selection_changed(cc->selection, (gpointer) cc);
@@ -613,7 +613,7 @@ connector_handle_motion_notify(SPConnectorContext *const cc, GdkEventMotion cons
SPDesktop *const dt = cc->desktop;
/* Find desktop coordinates */
- NR::Point p = dt->w2d(event_w);
+ Geom::Point p = to_2geom(dt->w2d(event_w));
switch (cc->state) {
case SP_CONNECTOR_CONTEXT_DRAGGING:
@@ -622,7 +622,7 @@ connector_handle_motion_notify(SPConnectorContext *const cc, GdkEventMotion cons
if ( cc->npoints > 0 ) {
cc->selection->clear();
- spcc_connector_set_subsequent_point(cc, p);
+ spcc_connector_set_subsequent_point(cc, from_2geom(p));
ret = TRUE;
}
break;
@@ -632,16 +632,16 @@ connector_handle_motion_notify(SPConnectorContext *const cc, GdkEventMotion cons
g_assert( SP_IS_PATH(cc->clickeditem));
// Update the hidden path
- NR::Matrix i2d = from_2geom(sp_item_i2d_affine(cc->clickeditem));
- NR::Matrix d2i = i2d.inverse();
+ Geom::Matrix i2d = sp_item_i2d_affine(cc->clickeditem);
+ Geom::Matrix d2i = i2d.inverse();
SPPath *path = SP_PATH(cc->clickeditem);
SPCurve *curve = (SP_SHAPE(path))->curve;
if (cc->clickedhandle == cc->endpt_handle[0]) {
- NR::Point o = cc->endpt_handle[1]->pos;
+ Geom::Point o = to_2geom(cc->endpt_handle[1]->pos);
curve->stretch_endpoints(p * d2i, o * d2i);
}
else {
- NR::Point o = cc->endpt_handle[0]->pos;
+ Geom::Point o = to_2geom(cc->endpt_handle[0]->pos);
curve->stretch_endpoints(o * d2i, p * d2i);
}
sp_conn_adjust_path(path);
@@ -857,7 +857,7 @@ spcc_connector_set_subsequent_point(SPConnectorContext *const cc, NR::Point cons
NR::Point p(route.ps[i].x, route.ps[i].y);
cc->red_curve->lineto(p);
}
- cc->red_curve->transform(dt->doc2dt());
+ cc->red_curve->transform(to_2geom(dt->doc2dt()));
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(cc->red_bpath), cc->red_curve);
}
spcc_concat_colors_and_flush(SPConnectorContext *cc)
{
SPCurve *c = cc->green_curve;
- cc->green_curve = new SPCurve(64);
+ cc->green_curve = new SPCurve();
cc->red_curve->reset();
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(cc->red_bpath), NULL);
}
/* Now we have to go back to item coordinates at last */
- c->transform(sp_desktop_dt2root_affine(SP_EVENT_CONTEXT_DESKTOP(cc)));
+ c->transform(to_2geom(sp_desktop_dt2root_affine(SP_EVENT_CONTEXT_DESKTOP(cc))));
SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc);
SPDocument *doc = sp_desktop_document(desktop);
// Show the red path for dragging.
cc->red_curve = SP_PATH(cc->clickeditem)->curve->copy();
- NR::Matrix i2d = from_2geom(sp_item_i2d_affine(cc->clickeditem));
+ Geom::Matrix i2d = sp_item_i2d_affine(cc->clickeditem);
cc->red_curve->transform(i2d);
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(cc->red_bpath), cc->red_curve);
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index b48c941ba27066039c6558ba3be2ab42232df1e6..075f7df9e5a36cbd4970c7ed7315164e841334e0 100644 (file)
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
#include "display/curve.h"
-#include <string.h>
-#include "libnr/nr-point.h"
-#include "libnr/nr-rect.h"
-#include <libnr/nr-point-matrix-ops.h>
-#include <libnr/nr-convert2geom.h>
-#include <cstring>
-#include <string>
+#include <glib/gmessages.h>
#include <2geom/pathvector.h>
#include <2geom/sbasis-geometric.h>
#include <2geom/sbasis-to-bezier.h>
-#include "svg/svg.h"
#include <2geom/point.h>
/* Constructors */
/**
* The returned curve's state is as if SPCurve::reset has just been called on it.
- * \param length Initial number of NArtBpath elements allocated for bpath (including NR_END
- * element).
- * 2GEOMproof
*/
-SPCurve::SPCurve(guint length)
+SPCurve::SPCurve()
: _refcount(1),
_pathv()
{
- if (length <= 0) {
- g_error("SPCurve::SPCurve called with invalid length parameter");
- throw;
- }
-
_pathv.clear();
}
{
SPCurve *c = new SPCurve();
- NR::Point p = rect.corner(0);
+ Geom::Point p = rect.corner(0);
c->moveto(p);
for (int i=3; i>=0; i--) {
return l;
}
-
-void
-SPCurve::transform(NR::Matrix const &m)
-{
- transform(to_2geom(m));
-};
-
-
/**
* Transform all paths in curve using matrix.
*/
void
SPCurve::transform(Geom::Matrix const &m)
{
- _pathv = _pathv * m;
+ _pathv *= m;
}
/**
* Set curve to empty curve.
+ * In more detail: this clears the internal pathvector from all its paths.
*/
void
SPCurve::reset()
void
SPCurve::moveto(gdouble x, gdouble y)
{
- moveto(NR::Point(x, y));
-}
-/**
- * Calls SPCurve::moveto() with point made of given coordinates.
- */
-void
-SPCurve::moveto(Geom::Point const &p)
-{
- moveto(from_2geom(p));
+ moveto(Geom::Point(x, y));
}
/**
* Perform a moveto to a point, thus starting a new subpath.
*/
void
-SPCurve::moveto(NR::Point const &p)
+SPCurve::moveto(Geom::Point const &p)
{
_pathv.push_back( Geom::Path() ); // for some reason Geom::Path(p) does not work...
- _pathv.back().start(to_2geom(p));
+ _pathv.back().start(p);
}
/**
{
lineto(p[Geom::X], p[Geom::Y]);
}
-/**
- * Calls SPCurve::lineto() with a point's coordinates.
- */
-void
-SPCurve::lineto(NR::Point const &p)
-{
- lineto(p[NR::X], p[NR::Y]);
-}
/**
* Adds a line to the current subpath.
*/
@@ -276,21 +238,8 @@ SPCurve::curveto(Geom::Point const &p0, Geom::Point const &p1, Geom::Point const
p1[X], p1[Y],
p2[X], p2[Y] );
}
-/**
- * Calls SPCurve::curveto() with coordinates of three points.
- */
-void
-SPCurve::curveto(NR::Point const &p0, NR::Point const &p1, NR::Point const &p2)
-{
- using NR::X;
- using NR::Y;
- curveto( p0[X], p0[Y],
- p1[X], p1[Y],
- p2[X], p2[Y] );
-}
/**
* Adds a bezier segment to the current subpath.
- * 2GEOMified
*/
void
SPCurve::curveto(gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble x2, gdouble y2)
/**
* Return first point of first subpath or (0,0). TODO: shouldn't this be (NR_HUGE, NR_HUGE) to be able to tell it apart from normal (0,0) ?
*/
-NR::Point
+Geom::Point
SPCurve::first_point() const
{
if (is_empty())
- return NR::Point(0, 0);
+ return Geom::Point(0, 0);
- return from_2geom( _pathv.front().initialPoint() );
+ return _pathv.front().initialPoint();
}
/**
*
* FIXME: for empty paths shouldn't this return (NR_HUGE,NR_HUGE)
*/
-NR::Point
+Geom::Point
SPCurve::second_point() const
{
if (is_empty()) {
- return NR::Point(0,0);
+ return Geom::Point(0,0);
}
else if (_pathv.front().empty()) {
// first path is only a moveto
/**
* TODO: fix comment: Return the second-last point of last subpath or _movePos if curve too short.
*/
-NR::Point
+Geom::Point
SPCurve::penultimate_point() const
{
Geom::Curve const& back = _pathv.back().back_default();
- Geom::Point p = back.initialPoint();
- return from_2geom(p);
+ return back.initialPoint();
}
/**
* Return last point of last subpath or (0,0). TODO: shouldn't this be (NR_HUGE, NR_HUGE) to be able to tell it apart from normal (0,0) ?
* If the last path is only a moveto, then return that point.
*/
-NR::Point
+Geom::Point
SPCurve::last_point() const
{
if (is_empty())
- return NR::Point(0, 0);
+ return Geom::Point(0, 0);
- return from_2geom( _pathv.back().finalPoint() );
+ return _pathv.back().finalPoint();
}
/**
* TODO: add comments about what this method does and what assumptions are made and requirements are put on SPCurve
*/
void
-SPCurve::stretch_endpoints(NR::Point const &new_p0, NR::Point const &new_p1)
+SPCurve::stretch_endpoints(Geom::Point const &new_p0, Geom::Point const &new_p1)
{
if (is_empty()) {
return;
}
- NR::Point const offset0( new_p0 - first_point() );
- NR::Point const offset1( new_p1 - last_point() );
+ Geom::Point const offset0( new_p0 - first_point() );
+ Geom::Point const offset1( new_p1 - last_point() );
Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = _pathv.front().toPwSb();
Geom::Piecewise<Geom::SBasis> arclength = Geom::arcLengthSb(pwd2);
throw;
}
arclength *= 1./arclength.lastValue();
- Geom::Point const A( to_2geom(offset0) );
- Geom::Point const B( to_2geom(offset1) );
+ Geom::Point const A( offset0 );
+ Geom::Point const B( offset1 );
Geom::Piecewise<Geom::SBasis> offsetx = (arclength*-1.+1)*A[0] + arclength*B[0];
Geom::Piecewise<Geom::SBasis> offsety = (arclength*-1.+1)*A[1] + arclength*B[1];
Geom::Piecewise<Geom::D2<Geom::SBasis> > offsetpath = Geom::sectionize( Geom::D2<Geom::Piecewise<Geom::SBasis> >(offsetx, offsety) );
* sets start of first path to new_p0, and end of first path to new_p1
*/
void
-SPCurve::move_endpoints(NR::Point const &new_p0, NR::Point const &new_p1)
+SPCurve::move_endpoints(Geom::Point const &new_p0, Geom::Point const &new_p1)
{
if (is_empty()) {
return;
}
- _pathv.front().setInitial(to_2geom(new_p0));
- _pathv.front().setFinal(to_2geom(new_p1));
+ _pathv.front().setInitial(new_p0);
+ _pathv.front().setFinal(new_p1);
}
/**
diff --git a/src/display/curve.h b/src/display/curve.h
index ce0ae8ba1ee8afa4f0350601340daae9bc55f4ff..c3659de078d9616a5d9c95ebb2ac3ddd5f7a21a8 100644 (file)
--- a/src/display/curve.h
+++ b/src/display/curve.h
#define SEEN_DISPLAY_CURVE_H
/** \file
- * Wrapper around an array of NArtBpath objects.
+ * Wrapper around a Geom::PathVector objects.
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
#include <2geom/forward.h>
-#include "libnr/nr-forward.h"
-
-#define SP_CURVE_LENSTEP 32
-
-struct SPObject;
-
-/// Wrapper around Geom::PathVector.
class SPCurve {
public:
/* Constructors */
- explicit SPCurve(guint length = SP_CURVE_LENSTEP);
+ explicit SPCurve();
explicit SPCurve(Geom::PathVector const& pathv);
static SPCurve * new_from_rect(Geom::Rect const &rect);
virtual ~SPCurve();
void set_pathvector(Geom::PathVector const & new_pathv);
- NArtBpath const * get_bpath() const;
Geom::PathVector const & get_pathvector() const;
- guint get_segment_count() const;
- guint nodes_in_path() const;
-
SPCurve * ref();
SPCurve * unref();
SPCurve * copy() const;
- GSList * split() const;
- void transform(NR::Matrix const &m);
- void transform(Geom::Matrix const &m);
- void stretch_endpoints(NR::Point const &, NR::Point const &);
- void move_endpoints(NR::Point const &, NR::Point const &);
- void last_point_additive_move(Geom::Point const & p);
+ guint get_segment_count() const;
+ guint nodes_in_path() const;
+
+ bool is_empty() const;
+ bool is_closed() const;
+ Geom::Curve const * last_segment() const;
+ Geom::Path const * last_path() const;
+ Geom::Curve const * first_segment() const;
+ Geom::Path const * first_path() const;
+ Geom::Point first_point() const;
+ Geom::Point last_point() const;
+ Geom::Point second_point() const;
+ Geom::Point penultimate_point() const;
void reset();
void moveto(Geom::Point const &p);
- void moveto(NR::Point const &p);
void moveto(gdouble x, gdouble y);
void lineto(Geom::Point const &p);
- void lineto(NR::Point const &p);
void lineto(gdouble x, gdouble y);
void curveto(Geom::Point const &p0, Geom::Point const &p1, Geom::Point const &p2);
- void curveto(NR::Point const &p0, NR::Point const &p1, NR::Point const &p2);
void curveto(gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble x2, gdouble y2);
void closepath();
void closepath_current();
+ void backspace();
- SPCurve * append_continuous(SPCurve const *c1, gdouble tolerance);
-
- bool is_empty() const;
- bool is_closed() const;
- Geom::Curve const * last_segment() const;
- Geom::Path const * last_path() const;
- Geom::Curve const * first_segment() const;
- Geom::Path const * first_path() const;
- NR::Point first_point() const;
- NR::Point last_point() const;
- NR::Point second_point() const;
- NR::Point penultimate_point() const;
+ void transform(Geom::Matrix const &m);
+ void stretch_endpoints(Geom::Point const &, Geom::Point const &);
+ void move_endpoints(Geom::Point const &, Geom::Point const &);
+ void last_point_additive_move(Geom::Point const & p);
void append(SPCurve const *curve2, bool use_lineto);
+ SPCurve * append_continuous(SPCurve const *c1, gdouble tolerance);
SPCurve * create_reverse() const;
- void backspace();
+ GSList * split() const;
static SPCurve * concat(GSList const *list);
protected:
diff --git a/src/draw-context.cpp b/src/draw-context.cpp
index 51938dc9eb800817e6ba3877f2ef42dccd48b120..19551dd6a6dbe38a0683a919b62f09415742fea0 100644 (file)
--- a/src/draw-context.cpp
+++ b/src/draw-context.cpp
dc->red_bpath = sp_canvas_bpath_new(sp_desktop_sketch(ec->desktop), NULL);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(dc->red_bpath), dc->red_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
/* Create red curve */
- dc->red_curve = new SPCurve(4);
+ dc->red_curve = new SPCurve();
/* Create blue bpath */
dc->blue_bpath = sp_canvas_bpath_new(sp_desktop_sketch(ec->desktop), NULL);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(dc->blue_bpath), dc->blue_color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
/* Create blue curve */
- dc->blue_curve = new SPCurve(8);
+ dc->blue_curve = new SPCurve();
/* Create green curve */
- dc->green_curve = new SPCurve(64);
+ dc->green_curve = new SPCurve();
/* No green anchor by default */
dc->green_anchor = NULL;
dc->green_closed = FALSE;
/* Curve list */
/* We keep it in desktop coordinates to eliminate calculation errors */
SPCurve *norm = sp_path_get_curve_for_edit (SP_PATH(item));
- norm->transform(from_2geom(sp_item_i2d_affine(dc->white_item)));
+ norm->transform(sp_item_i2d_affine(dc->white_item));
g_return_if_fail( norm != NULL );
dc->white_curves = g_slist_reverse(norm->split());
norm->unref();
SPCurve *c = dc->green_curve;
/* Green */
- dc->green_curve = new SPCurve(64);
+ dc->green_curve = new SPCurve();
while (dc->green_bpaths) {
gtk_object_destroy(GTK_OBJECT(dc->green_bpaths->data));
dc->green_bpaths = g_slist_remove(dc->green_bpaths, dc->green_bpaths->data);
/* Now we have to go back to item coordinates at last */
c->transform(( dc->white_item
- ? from_2geom(sp_item_dt2i_affine(dc->white_item))
- : sp_desktop_dt2root_affine(SP_EVENT_CONTEXT_DESKTOP(dc)) ));
+ ? sp_item_dt2i_affine(dc->white_item)
+ : to_2geom(sp_desktop_dt2root_affine(SP_EVENT_CONTEXT_DESKTOP(dc))) ));
SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc);
SPDocument *doc = sp_desktop_document(desktop);
index e90a6143cf79e431d1899f7836729b8503c740c8..75250c6048e8c4abfedaf69f4013c9388068705a 100644 (file)
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);
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));
}
}
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];
/* 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
diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp
index 49f86b03cdba897982f31e09e33496e142121faf..81025d2b2e3a06311f3e1a22dcaeddb918fdfda0 100644 (file)
--- a/src/eraser-context.cpp
+++ b/src/eraser-context.cpp
if (((SPEventContextClass *) eraser_parent_class)->setup)
((SPEventContextClass *) eraser_parent_class)->setup(ec);
- erc->accumulated = new SPCurve(32);
- erc->currentcurve = new SPCurve(4);
+ erc->accumulated = new SPCurve();
+ erc->currentcurve = new SPCurve();
- erc->cal1 = new SPCurve(32);
- erc->cal2 = new SPCurve(32);
+ erc->cal1 = new SPCurve();
+ erc->cal2 = new SPCurve();
erc->currentshape = sp_canvas_item_new(sp_desktop_sketch(ec->desktop), SP_TYPE_CANVAS_BPATH, NULL);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(erc->currentshape), ERC_RED_RGBA, SP_WIND_RULE_EVENODD);
index 2f381d1d79f686537f3e68d56e9a456b80d125e8..1eedfa3a71bc0d85f3e7ac8f49ac908db2959e6c 100644 (file)
{
SPCurve *curve = SP_SHAPE(lpeitem)->curve;
- A = curve->first_point().to_2geom();
- B = curve->last_point().to_2geom();
+ A = curve->first_point();
+ B = curve->last_point();
origin.param_setValue(A);
index e41d4084ddb4c10cf1b0cb9877af74b4810552fb..8095e5360a5e59d805d1b92f491ab15efb7aba42 100644 (file)
using namespace Geom;
SPCurve* curve = sp_path_get_curve_for_edit (param_path);
- Geom::Point A(curve->first_point().to_2geom());
- Geom::Point B(curve->last_point().to_2geom());
+ Geom::Point A(curve->first_point());
+ Geom::Point B(curve->last_point());
Piecewise<D2<SBasis> > rline = Piecewise<D2<SBasis> >(D2<SBasis>(Linear(A[X], B[X]), Linear(A[Y], B[Y])));
reflection_line.param_set_and_write_new_value(rline);
index 0d45fee2ac138e6638ee1a1be06623556ff0eb3c..68d61603d6ba8fa56086e1d7c5726ecc36987a66 100644 (file)
void
LPEOffset::doOnApply(SPLPEItem *lpeitem)
{
- offset_pt.param_set_and_write_new_value(SP_SHAPE(lpeitem)->curve->first_point().to_2geom());
+ offset_pt.param_set_and_write_new_value(SP_SHAPE(lpeitem)->curve->first_point());
}
static void append_half_circle(Geom::Piecewise<Geom::D2<Geom::SBasis> > &pwd2,
index 2f3a6d0cebdc1b2d26ee204fa67d888e3d2a6a3a..dba0f3a8db579b61ce917dc1db0b2645ae99c130 100644 (file)
{
SPCurve *curve = SP_SHAPE(lpeitem)->curve;
- A = curve->first_point().to_2geom();
- B = curve->last_point().to_2geom();
+ A = curve->first_point();
+ B = curve->last_point();
dir = unit_vector(B - A);
offset_pt.param_set_and_write_new_value((A + B)/2 + dir.ccw() * 100);
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index e4b080f4fe4e08a96efd1444a47e7dcdf211180f..d7ca69112257d1e611070d603d5e95a90ab6555b 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -158,7 +158,7 @@ static void sp_nodepath_draw_helper_curve(Inkscape::NodePath::Path *np, SPDeskto
// Draw helper curve
if (np->show_helperpath) {
SPCurve *helper_curve = np->curve->copy();
- helper_curve->transform(np->i2d );
+ helper_curve->transform(to_2geom(np->i2d));
np->helper_path = sp_canvas_bpath_new(sp_desktop_controls(desktop), helper_curve);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(np->helper_path), np->helperpath_rgba, np->helperpath_width, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(np->helper_path), 0, SP_WIND_RULE_NONZERO);
if (np->show_helperpath) {
SPCurve * helper_curve = np->curve->copy();
- helper_curve->transform(np->i2d );
+ helper_curve->transform(to_2geom(np->i2d));
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(np->helper_path), helper_curve);
helper_curve->unref();
}
if (np->show_helperpath) {
SPCurve * helper_curve = np->curve->copy();
- helper_curve->transform(np->i2d );
+ helper_curve->transform(to_2geom(np->i2d));
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(np->helper_path), helper_curve);
helper_curve->unref();
}
if (show) {
SPCurve *helper_curve = np->curve->copy();
- helper_curve->transform(np->i2d );
+ helper_curve->transform(to_2geom(np->i2d));
if (!np->helper_path) {
np->helper_path = sp_canvas_bpath_new(sp_desktop_controls(np->desktop), helper_curve);
sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(np->helper_path), np->helperpath_rgba, np->helperpath_width, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index 29c977e5d965e53fb74c6d4609572c295b5ee33d..9dfa760ea2c0280138bcf3e89aeea1f9f402fc15 100644 (file)
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
//c->transform(item->transform);
curve = c;
} else {
- c->transform(item->getRelativeTransform(SP_OBJECT(first)));
+ c->transform(to_2geom(item->getRelativeTransform(SP_OBJECT(first))));
curve->append(c, false);
c->unref();
}
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index e62d45192ddba178bbbed0b1c1e382f59403279a..46ae695fb14f2dcdc537f4a15e3d6f4270f91840 100644 (file)
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
pc->p[1] = pc->p[0];
}
NR::Point const pt(( pc->npoints < 4
- ? crv->finalPoint()
+ ? from_2geom(crv->finalPoint())
: pc->p[3] ));
pc->npoints = 2;
pc->green_curve->backspace();
diff --git a/src/rubberband.cpp b/src/rubberband.cpp
index 4b7b1c48f2bcef08418aa811bcffb29e453197a8..58f88bbfbf90ac75c8ea9c6f662b93767e4673b8 100644 (file)
--- a/src/rubberband.cpp
+++ b/src/rubberband.cpp
{
_points.clear();
_mode = RUBBERBAND_MODE_RECT;
- _touchpath_curve = new SPCurve(2000);
+ _touchpath_curve = new SPCurve();
}
void Inkscape::Rubberband::delete_canvas_items()
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 3ffd3eda2d88ff63d9bea1e95057041b62764818..aad26f050443749c0574d1d6422808248b72e737 100644 (file)
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -339,7 +339,7 @@ Geom::Point sp_guide_position_from_pt(SPGuide const *guide, NR::Point const &pt)
double sp_guide_distance_from_pt(SPGuide const *guide, Geom::Point const &pt)
{
- return dot(pt - guide->point_on_line, guide->normal_to_line);
+ return Geom::dot(pt - guide->point_on_line, guide->normal_to_line);
}
/**
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 47d63b2b92e99724ce99d65c162b0bdb9f766615..0867cc3ad008cf40bd96073975d389e1da105dbb 100644 (file)
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
// Transform the original-d path or the (ordinary) path
if (path->original_curve) {
- path->original_curve->transform(xform);
+ path->original_curve->transform(to_2geom(xform));
sp_lpe_item_update_patheffect(path, true, true);
} else {
- shape->curve->transform(xform);
+ shape->curve->transform(to_2geom(xform));
}
// Adjust stroke