summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorNiko Kiirala <niko@kiirala.com>2007-07-21 07:00:28 +0000
committerkiirala <kiirala@users.sourceforge.net>2007-07-21 07:00:28 +0000
commitf3f8edbd42d260303b2d26cb3edd1f4e1b427dc9 (patch)
tree4f221d744a4b5c4e19edb7ddbb9b98c5482de4c6 /src/display
parentPatch from Felipe Sanches: support for feConvolveMatrix filter primitive (diff)
downloadinkscape-f3f8edbd42d260303b2d26cb3edd1f4e1b427dc9.tar.gz
inkscape-f3f8edbd42d260303b2d26cb3edd1f4e1b427dc9.zip
Added a missing link in making the filterRes attribute work
(bzr r3271)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/nr-filter.cpp27
-rw-r--r--src/display/nr-filter.h12
2 files changed, 29 insertions, 10 deletions
diff --git a/src/display/nr-filter.cpp b/src/display/nr-filter.cpp
index 73a3df415..47b05d0b8 100644
--- a/src/display/nr-filter.cpp
+++ b/src/display/nr-filter.cpp
@@ -406,27 +406,46 @@ void Filter::clear_primitives()
_primitive_count = 0;
}
-void Filter::set_x(SVGLength &length)
+void Filter::set_x(SVGLength const &length)
{
if (length._set)
_region_x = length;
}
-void Filter::set_y(SVGLength &length)
+void Filter::set_y(SVGLength const &length)
{
if (length._set)
_region_y = length;
}
-void Filter::set_width(SVGLength &length)
+void Filter::set_width(SVGLength const &length)
{
if (length._set)
_region_width = length;
}
-void Filter::set_height(SVGLength &length)
+void Filter::set_height(SVGLength const &length)
{
if (length._set)
_region_height = length;
}
+void Filter::set_resolution(double const pixels) {
+ if (pixels > 0) {
+ _x_pixels = pixels;
+ _y_pixels = pixels;
+ }
+}
+
+void Filter::set_resolution(double const x_pixels, double const y_pixels) {
+ if (x_pixels >= 0 && y_pixels >= 0) {
+ _x_pixels = x_pixels;
+ _y_pixels = y_pixels;
+ }
+}
+
+void Filter::reset_resolution() {
+ _x_pixels = -1;
+ _y_pixels = -1;
+}
+
} /* namespace NR */
/*
diff --git a/src/display/nr-filter.h b/src/display/nr-filter.h
index baf23886e..835266e73 100644
--- a/src/display/nr-filter.h
+++ b/src/display/nr-filter.h
@@ -77,10 +77,10 @@ public:
*/
void set_output(int slot);
- void set_x(SVGLength &lenght);
- void set_y(SVGLength &length);
- void set_width(SVGLength &length);
- void set_height(SVGLength &length);
+ void set_x(SVGLength const &lenght);
+ void set_y(SVGLength const &length);
+ void set_width(SVGLength const &length);
+ void set_height(SVGLength const &length);
/**
* Sets the filter effects region.
@@ -105,7 +105,7 @@ public:
* resolution is determined automatically. If x_pixels is less than zero,
* calling this function results in no changes to filter state.
*/
- void set_resolution(double x_pixels);
+ void set_resolution(double const x_pixels);
/**
* Sets the width and height of intermediate images in pixels. If not set,
@@ -113,7 +113,7 @@ public:
* less than zero, calling this function results in no changes to filter
* state.
*/
- void set_resolution(double x_pixels, double y_pixels);
+ void set_resolution(double const x_pixels, double const y_pixels);
/**
* Resets the filter resolution to its default value, i.e. automatically