From f5d74fe46345673252807be3b6812bbb0469e457 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 8 Oct 2013 12:22:49 +0200 Subject: Seamlessly switch between SVG circle, ellipse, and path (arc) elements while using the Circle, Ellipse, and Arc tool. (bzr r12670) --- src/sp-lpe-item.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index b7e4ee4a9..61ba2ae0d 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -35,6 +35,7 @@ #include "inkscape.h" #include "desktop.h" #include "shape-editor.h" +#include "sp-ellipse.h" #include @@ -387,6 +388,10 @@ void SPLPEItem::addPathEffect(gchar *value, bool reset) this->getRepr()->setAttribute("inkscape:path-effect", hrefs.c_str()); + // Make sure that ellipse is stored as + if( SP_IS_GENERICELLIPSE(this)) { + SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT ); + } // make sure there is an original-d for paths!!! sp_lpe_item_create_original_path_recursive(this); @@ -436,6 +441,10 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths) this->getRepr()->setAttribute("inkscape:path-effect", r.c_str()); } else { this->getRepr()->setAttribute("inkscape:path-effect", NULL); + // Make sure that ellipse is stored as or if possible. + if( SP_IS_GENERICELLIPSE(this)) { + SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT ); + } } if (!keep_paths) { @@ -447,6 +456,11 @@ void SPLPEItem::removeAllPathEffects(bool keep_paths) { this->getRepr()->setAttribute("inkscape:path-effect", NULL); + // Make sure that ellipse is stored as or if possible. + if( SP_IS_GENERICELLIPSE(this)) { + SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT ); + } + if (!keep_paths) { sp_lpe_item_cleanup_original_path_recursive(this); } -- cgit v1.2.3