summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Lankow <geoff@darktrojan.net>2015-08-25 11:43:55 +0000
committer~suv <suv-sf@users.sourceforge.net>2015-08-25 11:43:55 +0000
commit703fd33768ff03de18419571cdc4a15bc956261f (patch)
tree952862fd3e010bcaf27d24acc75a7df1f784ce2f /src
parentFix a big on apply on closed path Transform By two knots (diff)
parentRead inkscape:color attribute in more places (diff)
downloadinkscape-703fd33768ff03de18419571cdc4a15bc956261f.tar.gz
inkscape-703fd33768ff03de18419571cdc4a15bc956261f.zip
Guides. Fix for bug #1374870 (Guide colour not rendered opening saved document)
Fixed bugs: - https://launchpad.net/bugs/1374870 (bzr r14323)
Diffstat (limited to 'src')
-rw-r--r--src/attributes.cpp1
-rw-r--r--src/attributes.h1
-rw-r--r--src/sp-guide.cpp7
-rw-r--r--src/sp-namedview.cpp12
4 files changed, 17 insertions, 4 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..b9c124138 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,11 @@ void SPGuide::release()
void SPGuide::set(unsigned int key, const gchar *value) {
switch (key) {
+ case SP_ATTR_INKSCAPE_COLOR:
+ if (value) {
+ 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..b8554f352 100644
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -249,6 +249,7 @@ void SPNamedView::build(SPDocument *document, Inkscape::XML::Node *repr) {
//g_object_set(G_OBJECT(g), "color", nv->guidecolor, "hicolor", nv->guidehicolor, NULL);
g->setColor(this->guidecolor);
g->setHiColor(this->guidehicolor);
+ g->readAttr( "inkscape:color" );
}
}
@@ -325,8 +326,9 @@ void SPNamedView::set(unsigned int key, const gchar* value) {
}
for (GSList *l = this->guides; l != NULL; l = l->next) {
- //g_object_set(G_OBJECT(l->data), "color", nv->guidecolor, NULL);
- SP_GUIDE(l->data)->setColor(this->guidecolor);
+ SPGuide * g = SP_GUIDE(l->data);
+ g->setColor(this->guidecolor);
+ g->readAttr("inkscape:color");
}
this->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -336,8 +338,9 @@ void SPNamedView::set(unsigned int key, const gchar* value) {
sp_nv_read_opacity(value, &this->guidecolor);
for (GSList *l = this->guides; l != NULL; l = l->next) {
- //g_object_set(G_OBJECT(l->data), "color", nv->guidecolor, NULL);
- SP_GUIDE(l->data)->setColor(this->guidecolor);
+ SPGuide * g = SP_GUIDE(l->data);
+ g->setColor(this->guidecolor);
+ g->readAttr("inkscape:color");
}
this->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -662,6 +665,7 @@ void SPNamedView::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *r
//g_object_set(G_OBJECT(g), "color", this->guidecolor, "hicolor", this->guidehicolor, NULL);
g->setColor(this->guidecolor);
g->setHiColor(this->guidehicolor);
+ g->readAttr("inkscape:color");
if (this->editable) {
for (GSList *l = this->views; l != NULL; l = l->next) {