From 43f80e25517651b82754e3b05303dacff0c03a10 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Tue, 7 Jul 2015 21:22:31 +1200 Subject: Read inkscape:color attribute on guides (bzr r14228.1.1) --- src/attributes.cpp | 1 + src/attributes.h | 1 + src/sp-guide.cpp | 5 +++++ src/sp-namedview.cpp | 1 - 4 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/attributes.cpp b/src/attributes.cpp index af19360c1..991834cb2 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -125,6 +125,7 @@ static SPStyleProp const props[] = { /* SPGuide */ {SP_ATTR_ORIENTATION, "orientation"}, {SP_ATTR_POSITION, "position"}, + {SP_ATTR_INKSCAPE_COLOR, "inkscape:color"}, /* SPImage */ {SP_ATTR_X, "x"}, {SP_ATTR_Y, "y"}, diff --git a/src/attributes.h b/src/attributes.h index 7d6ea70a0..47f1388b0 100644 --- a/src/attributes.h +++ b/src/attributes.h @@ -127,6 +127,7 @@ enum SPAttributeEnum { /* SPGuide */ SP_ATTR_ORIENTATION, SP_ATTR_POSITION, + SP_ATTR_INKSCAPE_COLOR, /* SPImage */ SP_ATTR_X, SP_ATTR_Y, diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 4e1c5913d..83e723e5c 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -26,6 +26,7 @@ #include "display/sp-canvas.h" #include "display/guideline.h" #include "svg/svg.h" +#include "svg/svg-color.h" #include "svg/stringstream.h" #include "attributes.h" #include "sp-guide.h" @@ -70,6 +71,7 @@ void SPGuide::build(SPDocument *document, Inkscape::XML::Node *repr) { SPObject::build(document, repr); + this->readAttr( "inkscape:color" ); this->readAttr( "inkscape:label" ); this->readAttr( "orientation" ); this->readAttr( "position" ); @@ -95,6 +97,9 @@ void SPGuide::release() void SPGuide::set(unsigned int key, const gchar *value) { switch (key) { + case SP_ATTR_INKSCAPE_COLOR: + this->setColor(sp_svg_read_color(value, 0x0000ff00) | 0x7f); + break; case SP_ATTR_INKSCAPE_LABEL: if (this->label) g_free(this->label); diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 12c2cdf8e..1b5d9e3e2 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -247,7 +247,6 @@ void SPNamedView::build(SPDocument *document, Inkscape::XML::Node *repr) { SPGuide * g = SP_GUIDE(o); this->guides = g_slist_prepend(this->guides, g); //g_object_set(G_OBJECT(g), "color", nv->guidecolor, "hicolor", nv->guidehicolor, NULL); - g->setColor(this->guidecolor); g->setHiColor(this->guidehicolor); } } -- cgit v1.2.3