diff options
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/nr-filter.cpp | 27 | ||||
| -rw-r--r-- | src/display/nr-filter.h | 12 |
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 |
