diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-10-02 22:44:54 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-10-02 22:44:54 +0000 |
| commit | 90e142963afd950b2868434075890054aef090b3 (patch) | |
| tree | edcaf3d0d85b614e5f327fb58c909ffee5207e26 /src/sp-mesh-patch.cpp | |
| parent | Added some widgets from caligraphic tool (diff) | |
| parent | Adjust dock size to minimum width during canvas table size allocation signal. (diff) | |
| download | inkscape-90e142963afd950b2868434075890054aef090b3.tar.gz inkscape-90e142963afd950b2868434075890054aef090b3.zip | |
Update to trunk and some fixes
(bzr r14865.1.14)
Diffstat (limited to 'src/sp-mesh-patch.cpp')
| -rw-r--r-- | src/sp-mesh-patch.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/sp-mesh-patch.cpp b/src/sp-mesh-patch.cpp index 834c09935..9a173a8db 100644 --- a/src/sp-mesh-patch.cpp +++ b/src/sp-mesh-patch.cpp @@ -18,7 +18,6 @@ #include "style.h" #include "attributes.h" -#include "xml/repr.h" SPMeshpatch* SPMeshpatch::getNextMeshpatch() { @@ -58,7 +57,6 @@ SPMeshpatch* SPMeshpatch::getPrevMeshpatch() /* * Mesh Patch */ - SPMeshpatch::SPMeshpatch() : SPObject() { this->tensor_string = NULL; } @@ -75,7 +73,6 @@ void SPMeshpatch::build(SPDocument* doc, Inkscape::XML::Node* repr) { /** * Virtual build: set meshpatch attributes from its associated XML node. */ - void SPMeshpatch::set(unsigned int key, const gchar* value) { switch (key) { case SP_ATTR_TENSOR: { @@ -92,9 +89,36 @@ void SPMeshpatch::set(unsigned int key, const gchar* value) { } /** - * Virtual set: set attribute to value. + * modified */ +void SPMeshpatch::modified(unsigned int flags) { + flags &= SP_OBJECT_MODIFIED_CASCADE; + GSList *l = NULL; + + for (auto& child: children) { + sp_object_ref(&child); + l = g_slist_prepend(l, &child); + } + + l = g_slist_reverse(l); + + while (l) { + SPObject *child = SP_OBJECT(l->data); + l = g_slist_remove(l, child); + + if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { + child->emitModified(flags); + } + + sp_object_unref(child); + } +} + + +/** + * Virtual set: set attribute to value. + */ Inkscape::XML::Node* SPMeshpatch::write(Inkscape::XML::Document* xml_doc, Inkscape::XML::Node* repr, guint flags) { if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { repr = xml_doc->createElement("svg:meshpatch"); |
