summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1eaf846)
raw | patch | inline | side by side (parent: 1eaf846)
author | Jasper van de Gronde <jasper.vandegronde@gmail.com> | |
Thu, 15 Apr 2010 19:14:51 +0000 (21:14 +0200) | ||
committer | Jasper van de Gronde <jasper.vandegronde@gmail.com> | |
Thu, 15 Apr 2010 19:14:51 +0000 (21:14 +0200) |
src/display/nr-filter.cpp | patch | blob | history | |
src/sp-filter.cpp | patch | blob | history |
index d0e0ec11e4e5d6c8c439e3f2af27d28028424075..3b19ff69ba6f996ac0a91e2b34183f876be8c50b 100644 (file)
return 0;
}
+void Filter::set_filter_units(SPFilterUnits unit) {
+ _filter_units = unit;
+}
+
+void Filter::set_primitive_units(SPFilterUnits unit) {
+ _primitive_units = unit;
+}
+
void Filter::area_enlarge(NRRectL &bbox, NRArenaItem const *item) const {
for (int i = 0 ; i < _primitive_count ; i++) {
if (_primitive[i]) _primitive[i]->area_enlarge(bbox, item->ctm);
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp
index 7197c1ec93539c53810f0d0db80ac58703a24882..4cbafe50cf2e3b6ff7265c531925783fce1c05c6 100644 (file)
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
filter->height = 0;
filter->filterUnits = SP_FILTER_UNITS_OBJECTBOUNDINGBOX;
- filter->primitiveUnits = SP_FILTER_UNITS_OBJECTBOUNDINGBOX;
+ filter->primitiveUnits = SP_FILTER_UNITS_USERSPACEONUSE;
filter->filterUnits_set = FALSE;
filter->primitiveUnits_set = FALSE;
break;
case SP_ATTR_PRIMITIVEUNITS:
if (value) {
- if (!strcmp(value, "userSpaceOnUse")) {
- filter->primitiveUnits = SP_FILTER_UNITS_USERSPACEONUSE;
- } else {
+ if (!strcmp(value, "objectBoundingBox")) {
filter->primitiveUnits = SP_FILTER_UNITS_OBJECTBOUNDINGBOX;
+ } else {
+ filter->primitiveUnits = SP_FILTER_UNITS_USERSPACEONUSE;
}
filter->primitiveUnits_set = TRUE;
} else {
- filter->primitiveUnits = SP_FILTER_UNITS_OBJECTBOUNDINGBOX;
+ filter->primitiveUnits = SP_FILTER_UNITS_USERSPACEONUSE;
filter->primitiveUnits_set = FALSE;
}
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
@@ -322,11 +322,11 @@ sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::N
if ((flags & SP_OBJECT_WRITE_ALL) || filter->primitiveUnits_set) {
switch (filter->primitiveUnits) {
- case SP_FILTER_UNITS_USERSPACEONUSE:
- repr->setAttribute("primitiveUnits", "userSpaceOnUse");
+ case SP_FILTER_UNITS_OBJECTBOUNDINGBOX:
+ repr->setAttribute("primitiveUnits", "objectBoundingBox");
break;
default:
- repr->setAttribute("primitiveUnits", "objectBoundingBox");
+ repr->setAttribute("primitiveUnits", "userSpaceOnUse");
break;
}
}
@@ -446,6 +446,8 @@ void sp_filter_build_renderer(SPFilter *sp_filter, Inkscape::Filters::Filter *nr
sp_filter->_renderer = nr_filter;
+ nr_filter->set_filter_units(sp_filter->filterUnits);
+ nr_filter->set_primitive_units(sp_filter->primitiveUnits);
nr_filter->set_x(sp_filter->x);
nr_filter->set_y(sp_filter->y);
nr_filter->set_width(sp_filter->width);