X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-ellipse.cpp;h=b6f510201e5e45d6584167af3a7264be22ed68e4;hb=6c3e745a94ef6b25a4ef9f018d350a7535aa45af;hp=1970a80341bffe456986ffc760137e89e07c2b70;hpb=0e14f9e966c4b6012538d30cd0db7a775b879760;p=inkscape.git diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 1970a8034..b6f510201 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -32,7 +32,7 @@ #include "document.h" #include "sp-ellipse.h" -#include "prefs-utils.h" +#include "preferences.h" /* Common parent class */ @@ -72,7 +72,7 @@ static void sp_genericellipse_init(SPGenericEllipse *ellipse); static void sp_genericellipse_update(SPObject *object, SPCtx *ctx, guint flags); -static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p); +static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs); static void sp_genericellipse_set_shape(SPShape *shape); static void sp_genericellipse_update_patheffect (SPLPEItem *lpeitem, bool write); @@ -243,19 +243,28 @@ static void sp_genericellipse_set_shape(SPShape *shape) Geom::Matrix aff = Geom::Scale(rx, ry) * Geom::Translate(ellipse->cx.computed, ellipse->cy.computed); curve->transform(aff); - sp_lpe_item_perform_path_effect(SP_LPE_ITEM (ellipse), curve); - sp_shape_set_curve_insync((SPShape *) ellipse, curve, TRUE); + /* 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)*/ + sp_shape_set_curve_insync (shape, curve, TRUE); + if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) { + SPCurve *c_lpe = curve->copy(); + bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe); + if (success) { + sp_shape_set_curve_insync (shape, c_lpe, TRUE); + } + c_lpe->unref(); + } curve->unref(); } -static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p) +static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs) { g_assert(item != NULL); g_assert(SP_IS_GENERICELLIPSE(item)); SPGenericEllipse *ellipse = SP_GENERICELLIPSE(item); sp_genericellipse_normalize(ellipse); - NR::Matrix const i2d = from_2geom(sp_item_i2d_affine(item)); + NR::Matrix const i2d = sp_item_i2d_affine(item); // figure out if we have a slice, whilst guarding against rounding errors bool slice = false; @@ -858,11 +867,12 @@ sp_arc_position_set(SPArc *arc, gdouble x, gdouble y, gdouble rx, gdouble ry) ge->cy.computed = y; ge->rx.computed = rx; ge->ry.computed = ry; - if (prefs_get_double_attribute("tools.shapes.arc", "start", 0.0) != 0) - ge->start = prefs_get_double_attribute("tools.shapes.arc", "start", 0.0); - if (prefs_get_double_attribute("tools.shapes.arc", "end", 0.0) != 0) - ge->end = prefs_get_double_attribute("tools.shapes.arc", "end", 0.0); - if (!prefs_get_string_attribute("tools.shapes.arc", "open")) + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + if (prefs->getDouble("/tools/shapes/arc/start", 0.0) != 0) + ge->start = prefs->getDouble("/tools/shapes/arc/start", 0.0); + if (prefs->getDouble("/tools/shapes/arc/end", 0.0) != 0) + ge->end = prefs->getDouble("/tools/shapes/arc/end", 0.0); + if (!prefs->getBool("/tools/shapes/arc/open")) ge->closed = 1; else ge->closed = 0;