diff options
| author | Andrew Higginson <at.higginson@gmail.com> | 2011-12-27 21:04:47 +0000 |
|---|---|---|
| committer | Andrew <at.higginson@gmail.com> | 2011-12-27 21:04:47 +0000 |
| commit | 80960b623a99aae1402ab651b2974ef544ed3b03 (patch) | |
| tree | ba49d42c2789e9e11f805e2d5263e10f9fedeef8 /src/sp-filter.cpp | |
| parent | try to fix bug (diff) | |
| parent | GDL: Cherry-pick upstream patch 73852 (2011-03-23) - Add missing return value. (diff) | |
| download | inkscape-80960b623a99aae1402ab651b2974ef544ed3b03.tar.gz inkscape-80960b623a99aae1402ab651b2974ef544ed3b03.zip | |
merged with trunk so I can build again...
(bzr r10092.1.36)
Diffstat (limited to 'src/sp-filter.cpp')
| -rw-r--r-- | src/sp-filter.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index fd4319320..d0fd59802 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -28,6 +28,7 @@ using std::pair; #include "document.h" #include "sp-filter.h" #include "sp-filter-reference.h" +#include "sp-filter-primitive.h" #include "uri.h" #include "xml/repr.h" #include <cstring> @@ -369,12 +370,22 @@ sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::N // TODO: This is evil, correctly implement support for color-interpolation-filters!!! // The color-interpolation-filters attribute is initially set to linearRGB according to the SVG standard. - // However, Inkscape completely ignores it and implicitly assumes that it is sRGB (like color-interpolation-filters). + // However, Inkscape completely ignores it and implicitly assumes that it is sRGB (like color-interpolation). // This results in a discrepancy between Inkscape and other renderers in how they render filters. // To mitigate this problem I've (Jasper van de Gronde,th.v.d.gronde@hccnet.nl) added this to ensure that at least // any filters written by Inkscape will henceforth be rendered the same in other renderers. // In the future Inkscape should have proper support for the color-interpolation properties and this should be changed. - repr->setAttribute("color-interpolation-filters", "sRGB"); + + // repr->setAttribute("color-interpolation-filters", "sRGB"); + + // Actually, the above line is not correct as the attribute is only allowed on filter + // primitives and not <filter> objects. However, it is allowed as a property in a style + // attribute. Note, this property must also be set in sp-filter-chemistry, filter_new() as the + // code here is not necessarily called when a new filter is created. 29 Aug 2011 Tav. + SPCSSAttr *css = sp_repr_css_attr_new(); + sp_repr_css_set_property(css, "color-interpolation-filters", "sRGB"); + sp_repr_css_change(repr, css, "style"); + sp_repr_css_attr_unref(css); if (((SPObjectClass *) filter_parent_class)->write) { ((SPObjectClass *) filter_parent_class)->write(object, doc, repr, flags); |
