diff options
Diffstat (limited to 'src/sp-path.cpp')
| -rw-r--r-- | src/sp-path.cpp | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/src/sp-path.cpp b/src/sp-path.cpp index c4d24c503..b593b7937 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -16,7 +16,7 @@ */ #ifdef HAVE_CONFIG_H -# include <config.h> +#include <config.h> #endif #include <glibmm/i18n.h> @@ -27,7 +27,6 @@ #include "sp-lpe-item.h" #include "display/curve.h" -#include <2geom/pathvector.h> #include <2geom/curves.h> #include "helper/geom-curves.h" @@ -46,7 +45,6 @@ #include "inkscape.h" #include "style.h" #include "message-stack.h" -#include "selection.h" #define noPATH_VERBOSE @@ -189,35 +187,35 @@ void SPPath::release() { void SPPath::set(unsigned int key, const gchar* value) { switch (key) { case SP_ATTR_INKSCAPE_ORIGINAL_D: - if (value) { - Geom::PathVector pv = sp_svg_read_pathv(value); - SPCurve *curve = new SPCurve(pv); - - if (curve) { - this->set_original_curve(curve, TRUE, true); - curve->unref(); - } - } else { - this->set_original_curve(NULL, TRUE, true); - } - - this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + if (value) { + Geom::PathVector pv = sp_svg_read_pathv(value); + SPCurve *curve = new SPCurve(pv); + + if (curve) { + this->set_original_curve(curve, TRUE, true); + curve->unref(); + } + } else { + this->set_original_curve(NULL, TRUE, true); + } + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_D: - if (value) { - Geom::PathVector pv = sp_svg_read_pathv(value); - SPCurve *curve = new SPCurve(pv); - - if (curve) { - this->setCurve(curve, TRUE); - curve->unref(); - } - } else { - this->setCurve(NULL, TRUE); - } - - this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + if (value) { + Geom::PathVector pv = sp_svg_read_pathv(value); + SPCurve *curve = new SPCurve(pv); + + if (curve) { + this->setCurve(curve, TRUE); + curve->unref(); + } + } else { + this->setCurve(NULL, TRUE); + } + + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; case SP_PROP_MARKER: @@ -278,13 +276,13 @@ g_message("sp_path_write writes 'd' attribute"); } void SPPath::update(SPCtx *ctx, guint flags) { - if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { - flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // since we change the description, it's not a "just translation" anymore - } + if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { + flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // since we change the description, it's not a "just translation" anymore + } - SPShape::update(ctx, flags); + SPShape::update(ctx, flags); - this->connEndPair.update(); + this->connEndPair.update(); } Geom::Affine SPPath::set_transform(Geom::Affine const &transform) { |
