diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index aced4ec53148202bd51086c710d006bb95147d36..9c04120e1e8dea67091c679d1e7185a93cba5697 100644 (file)
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
sp_repr_set_svg_double(repr, "sodipodi:t0", spiral->t0);
}
+ // make sure the curve is rebuilt with all up-to-date parameters
+ sp_spiral_set_shape ((SPShape *) spiral);
+
//Duplicate the path
SPCurve *curve = ((SPShape *) spiral)->curve;
//Nulls might be possible if this called iteratively
spiral = SP_SPIRAL (object);
shape = SP_SHAPE (object);
- /// \todo fixme: we should really collect updates
+ /// \todo fixme: we should really collect updates
switch (key) {
case SP_ATTR_SODIPODI_CX:
if (!sp_svg_length_read_computed_absolute (value, &spiral->cx)) {
break;
case SP_ATTR_SODIPODI_EXPANSION:
if (value) {
- /** \todo
- * FIXME: check that value looks like a (finite)
- * number. Create a routine that uses strtod, and
+ /** \todo
+ * FIXME: check that value looks like a (finite)
+ * number. Create a routine that uses strtod, and
* accepts a default value (if strtod finds an error).
- * N.B. atof/sscanf/strtod consider "nan" and "inf"
+ * N.B. atof/sscanf/strtod consider "nan" and "inf"
* to be valid numbers.
*/
spiral->exp = g_ascii_strtod (value, NULL);
if (value) {
spiral->arg = g_ascii_strtod (value, NULL);
/** \todo
- * FIXME: We still need some bounds on arg, for
- * numerical reasons. E.g., we don't want inf or NaN,
- * nor near-infinite numbers. I'm inclined to take
- * modulo 2*pi. If so, then change the knot editors,
- * which use atan2 - revo*2*pi, which typically
+ * FIXME: We still need some bounds on arg, for
+ * numerical reasons. E.g., we don't want inf or NaN,
+ * nor near-infinite numbers. I'm inclined to take
+ * modulo 2*pi. If so, then change the knot editors,
+ * which use atan2 - revo*2*pi, which typically
* results in very negative arg.
*/
} else {
spiral->t0 = CLAMP (spiral->t0, 0.0, 0.999);
/** \todo
* Have shared constants for the allowable bounds for
- * attributes. There was a bug here where we used -1.0
- * as the minimum (which leads to NaN via, e.g.,
- * pow(-1.0, 0.5); see sp_spiral_get_xy for
+ * attributes. There was a bug here where we used -1.0
+ * as the minimum (which leads to NaN via, e.g.,
+ * pow(-1.0, 0.5); see sp_spiral_get_xy for
* requirements.
*/
} else {
}
-/**
+/**
* Fit beziers together to spiral and draw it.
*
* \pre dstep \> 0.
&& (d < 1.0)) {
i--;
d += dstep;
- /** We mustn't increase dstep for subsequent values of
- * i: for large spiral.exp values, rate of growth
- * increases very rapidly.
+ /** We mustn't increase dstep for subsequent values of
+ * i: for large spiral.exp values, rate of growth
+ * increases very rapidly.
*/
- /** \todo
- * Get the function itself to decide what value of d
- * to use next: ensure that we move at least 0.25 *
- * stroke width, for example. The derivative (as used
- * for get_tangent before normalization) would be
- * useful for estimating the appropriate d value. Or
- * perhaps just start with a small dstep and scale by
- * some small number until we move >= 0.25 *
- * stroke_width. Must revert to the original dstep
- * value for next iteration to avoid the problem
+ /** \todo
+ * Get the function itself to decide what value of d
+ * to use next: ensure that we move at least 0.25 *
+ * stroke width, for example. The derivative (as used
+ * for get_tangent before normalization) would be
+ * useful for estimating the appropriate d value. Or
+ * perhaps just start with a small dstep and scale by
+ * some small number until we move >= 0.25 *
+ * stroke_width. Must revert to the original dstep
+ * value for next iteration to avoid the problem
* mentioned above.
*/
}
g_return_if_fail (SP_IS_SPIRAL (spiral));
/** \todo
- * Consider applying CLAMP or adding in-bounds assertions for
+ * Consider applying CLAMP or adding in-bounds assertions for
* some of these parameters.
*/
spiral->cx = cx;
}
}
-/**
+/**
* Return one of the points on the spiral.
*
* \param t specifies how far along the spiral.
- * \pre \a t in [0.0, 2.03]. (It doesn't make sense for t to be much more
- * than 1.0, though some callers go slightly beyond 1.0 for curve-fitting
+ * \pre \a t in [0.0, 2.03]. (It doesn't make sense for t to be much more
+ * than 1.0, though some callers go slightly beyond 1.0 for curve-fitting
* purposes.)
*/
NR::Point sp_spiral_get_xy (SPSpiral const *spiral, gdouble t)
}
-/**
+/**
* Returns the derivative of sp_spiral_get_xy with respect to t,
* scaled to a unit vector.
*
NR::Point unrotated(spiral->exp, t_scaled);
double const s_len = L2 (unrotated);
g_assert (s_len != 0);
- /** \todo
- * Check that this isn't being too hopeful of the hypot
- * function. E.g. test with numbers around 2**-1070
- * (denormalized numbers), preferably on a few different
- * platforms. However, njh says that the usual implementation
+ /** \todo
+ * Check that this isn't being too hopeful of the hypot
+ * function. E.g. test with numbers around 2**-1070
+ * (denormalized numbers), preferably on a few different
+ * platforms. However, njh says that the usual implementation
* does handle both very big and very small numbers.
*/
unrotated /= s_len;
so ret is already of unit length other than numerical
error in the above matrix multiplication. */
- /** \todo
- * I haven't checked how important it is for ret to be very
+ /** \todo
+ * I haven't checked how important it is for ret to be very
* near unit length; we could get rid of the below.
*/