diff options
Diffstat (limited to 'src/sp-star.cpp')
| -rw-r--r-- | src/sp-star.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 6b6914500..39efe2537 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -284,7 +284,7 @@ sp_star_update_patheffect(SPLPEItem *lpeitem, bool write) sp_star_set_shape(shape); if (write) { - Inkscape::XML::Node *repr = SP_OBJECT_REPR(shape); + Inkscape::XML::Node *repr = shape->getRepr(); if ( shape->curve != NULL ) { gchar *str = sp_svg_write_path(shape->curve->get_pathvector()); repr->setAttribute("d", str); @@ -411,7 +411,7 @@ sp_star_get_curvepoint (SPStar *star, SPStarPoint point, gint index, bool previ) guint32 seed = point_unique_int (o); // randomly rotate (by step 3 from the seed) and scale (by step 4) the vector - ret = ret * Geom::Matrix (Geom::Rotate (star->randomized * M_PI * rnd (seed, 3))); + ret = ret * Geom::Affine (Geom::Rotate (star->randomized * M_PI * rnd (seed, 3))); ret *= ( 1 + star->randomized * rnd (seed, 4)); // the randomized corner point @@ -435,11 +435,12 @@ sp_star_set_shape (SPShape *shape) // by disabling the entire stack (including the shape LPE) if (sp_lpe_item_has_broken_path_effect(SP_LPE_ITEM(shape))) { g_warning ("The star shape has unknown LPE on it! Convert to path to make it editable preserving the appearance; editing it as star will remove the bad LPE"); - if (SP_OBJECT_REPR(shape)->attribute("d")) { + if (shape->getRepr()->attribute("d")) { // unconditionally read the curve from d, if any, to preserve appearance - Geom::PathVector pv = sp_svg_read_pathv(SP_OBJECT_REPR(shape)->attribute("d")); + Geom::PathVector pv = sp_svg_read_pathv(shape->getRepr()->attribute("d")); SPCurve *cold = new SPCurve(pv); shape->setCurveInsync( cold, TRUE); + shape->setCurveBeforeLPE(cold); cold->unref(); } return; @@ -510,6 +511,7 @@ sp_star_set_shape (SPShape *shape) /* Reset the shape'scurve to the "original_curve" * This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/ shape->setCurveInsync( c, TRUE); + shape->setCurveBeforeLPE( c ); if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) { SPCurve *c_lpe = c->copy(); bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe); @@ -540,7 +542,7 @@ sp_star_position_set (SPStar *star, gint sides, Geom::Point center, gdouble r1, star->flatsided = isflat; star->rounded = rounded; star->randomized = randomized; - SP_OBJECT(star)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + star->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } static void sp_star_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) @@ -560,7 +562,7 @@ static void sp_star_snappoints(SPItem const *item, std::vector<Inkscape::SnapCan } if (snapprefs->getSnapObjectMidpoints()) { - Geom::Matrix const i2d (item->i2d_affine ()); + Geom::Affine const i2d (item->i2d_affine ()); p.push_back(Inkscape::SnapCandidatePoint(SP_STAR(item)->center * i2d,Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT)); } } |
