summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f247fd9)
raw | patch | inline | side by side (parent: f247fd9)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 6 Jun 2008 22:50:40 +0000 (22:50 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Fri, 6 Jun 2008 22:50:40 +0000 (22:50 +0000) |
- make SPCurve::transform safe to work on both pathv and bpath
src/display/curve.cpp | patch | blob | history |
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index eb86773f91dbdf76b5bced293e25063e71377274..d3322ea83fedac68dcff02ecc55f33a17ded63f0 100644 (file)
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
static unsigned sp_bpath_length(NArtBpath const bpath[]);
static bool sp_bpath_closed(NArtBpath const bpath[]);
-#define NO_CHECKS
+// #define NO_CHECKS // define this to disable the warnings about unequal paths in SPCurve
static void debug_out( char const * text, Geom::PathVector const & pathv) {
#ifndef NO_CHECKS
NArtBpath const *
SPCurve::get_bpath() const
{
+ debug_check("SPCurve::get_bpath", this);
return _bpath;
};
Geom::PathVector const &
SPCurve::get_pathvector() const
{
+ debug_check("SPCurve::get_pathvector", this);
return _pathv;
}
{
tmpl_curve_transform<NR::Matrix>(this, m);
- transform(to_2geom(m));
+ _pathv = _pathv * to_2geom(m);
- debug_check("SPCurve::transform", this);
+ debug_check("SPCurve::transform(NR::Matrix const &m)", this);
}
/**
void
SPCurve::transform(Geom::Matrix const &m)
{
+ tmpl_curve_transform<NR::Matrix>(this, from_2geom(m));
+
_pathv = _pathv * m;
+
+ debug_check("SPCurve::transform(Geom::Matrix const &m)", this);
}
/**
{
tmpl_curve_transform<NR::translate>(this, m);
- transform(to_2geom(m));
+ _pathv = _pathv * to_2geom(m);
- debug_check("SPCurve::transform translate", this);
+ debug_check("SPCurve::transform(NR::translate const &m)", this);
}
/**
{
g_return_val_if_fail(this != NULL, TRUE);
+ if (!_bpath)
+ return true;
+
bool empty = _pathv.empty(); /* || _pathv.front().empty(); */
debug_check("SPCurve::is_empty", (_bpath->code == NR_END) == empty );