summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Lankow <geoff@darktrojan.net>2015-07-07 09:22:31 +0000
committerGeoff Lankow <geoff@darktrojan.net>2015-07-07 09:22:31 +0000
commit43f80e25517651b82754e3b05303dacff0c03a10 (patch)
treeb6be78397c84152c8eee77a6129a5f91cff6df1a /src
parentFix compilation failure in make check (diff)
downloadinkscape-43f80e25517651b82754e3b05303dacff0c03a10.tar.gz
inkscape-43f80e25517651b82754e3b05303dacff0c03a10.zip
Read inkscape:color attribute on guides
(bzr r14228.1.1)
Diffstat (limited to 'src')
-rw-r--r--src/attributes.cpp1
-rw-r--r--src/attributes.h1
-rw-r--r--src/sp-guide.cpp5
-rw-r--r--src/sp-namedview.cpp1
4 files changed, 7 insertions, 1 deletions
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);
}
}