X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-star.cpp;h=2f3dcd6c1f23bf6e5767cbf65609f3d8d078e98c;hb=761a541468cc0b8a7fcfb8c65784c0896f0f80f4;hp=dfa34be9525c88cecae2c9bddcac3d42afdb0837;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/sp-star.cpp b/src/sp-star.cpp index dfa34be95..2f3dcd6c1 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -16,9 +16,7 @@ #include "config.h" -#if defined(WIN32) || defined(__APPLE__) -# include -#endif +#include #include "svg/svg.h" #include "attributes.h" @@ -146,7 +144,7 @@ sp_star_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) } sp_star_set_shape ((SPShape *) star); - char *d = sp_svg_write_path (((SPShape *) star)->curve->bpath); + char *d = sp_svg_write_path (SP_CURVE_BPATH(((SPShape *) star)->curve)); repr->setAttribute("d", d); g_free (d); @@ -259,8 +257,8 @@ sp_star_set (SPObject *object, unsigned int key, const gchar *value) static void sp_star_update (SPObject *object, SPCtx *ctx, guint flags) { - if (flags & (SP_OBJECT_MODIFIED_FLAG | - SP_OBJECT_STYLE_MODIFIED_FLAG | + if (flags & (SP_OBJECT_MODIFIED_FLAG | + SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { sp_shape_set_shape ((SPShape *) object); } @@ -305,9 +303,9 @@ Obvious (but acceptable for my purposes) limits to uniqueness: static guint32 point_unique_int (NR::Point o) { - return ((guint32) - 65536 * - (((int) floor (o[NR::X] * 64)) % 1024 + ((int) floor (o[NR::X] * 1024)) % 64) + return ((guint32) + 65536 * + (((int) floor (o[NR::X] * 64)) % 1024 + ((int) floor (o[NR::X] * 1024)) % 64) + (((int) floor (o[NR::Y] * 64)) % 1024 + ((int) floor (o[NR::Y] * 1024)) % 64) ); @@ -358,7 +356,7 @@ sp_star_get_curvepoint (SPStar *star, SPStarPoint point, gint index, bool previ) // point to which we direct the bissector of the curve handles; // it's far enough outside the star on the perpendicular to prev-next through mid - NR::Point biss = mid + 100000 * rot90_rel (mid, next); + NR::Point biss = mid + 100000 * rot90_rel (mid, next); // lengths of vectors to prev and next gdouble prev_len = NR::L2 (prev - o); @@ -416,7 +414,7 @@ sp_star_set_shape (SPShape *shape) if (not_rounded) { sp_curve_lineto (c, sp_star_get_xy (star, SP_STAR_POINT_KNOT2, 0, true)); } else { - sp_curve_curveto (c, + sp_curve_curveto (c, sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, 0, NEXT), sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT2, 0, PREV), sp_star_get_xy (star, SP_STAR_POINT_KNOT2, 0, true)); @@ -429,12 +427,12 @@ sp_star_set_shape (SPShape *shape) sp_curve_lineto (c, sp_star_get_xy (star, SP_STAR_POINT_KNOT1, i, true)); } else { if (star->flatsided == false) { - sp_curve_curveto (c, + sp_curve_curveto (c, sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT2, i - 1, NEXT), sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, i, PREV), sp_star_get_xy (star, SP_STAR_POINT_KNOT1, i, true)); } else { - sp_curve_curveto (c, + sp_curve_curveto (c, sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, i - 1, NEXT), sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, i, PREV), sp_star_get_xy (star, SP_STAR_POINT_KNOT1, i, true)); @@ -458,12 +456,12 @@ sp_star_set_shape (SPShape *shape) sp_curve_lineto (c, sp_star_get_xy (star, SP_STAR_POINT_KNOT1, 0, true)); } else { if (star->flatsided == false) { - sp_curve_curveto (c, + sp_curve_curveto (c, sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT2, sides - 1, NEXT), sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, 0, PREV), sp_star_get_xy (star, SP_STAR_POINT_KNOT1, 0, true)); } else { - sp_curve_curveto (c, + sp_curve_curveto (c, sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, sides - 1, NEXT), sp_star_get_curvepoint (star, SP_STAR_POINT_KNOT1, 0, PREV), sp_star_get_xy (star, SP_STAR_POINT_KNOT1, 0, true));