diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2015-09-15 10:13:14 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2015-09-15 10:13:14 +0000 |
| commit | 3005a32786badbc125628fd30f03ccdc32bb03d4 (patch) | |
| tree | 6ea6170c46a9d9e0ce41638b123aeff5e0fd307a /src | |
| parent | Fix for 1495106 (Add a check for id before sending a modified signal) (diff) | |
| download | inkscape-3005a32786badbc125628fd30f03ccdc32bb03d4.tar.gz inkscape-3005a32786badbc125628fd30f03ccdc32bb03d4.zip | |
Don't need bounding box if 'primitiveUnits' not 'objectBoundingBox'.
(bzr r14368)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/nr-filter-primitive.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/display/nr-filter-primitive.cpp b/src/display/nr-filter-primitive.cpp index c8b569036..ea72efff0 100644 --- a/src/display/nr-filter-primitive.cpp +++ b/src/display/nr-filter-primitive.cpp @@ -110,17 +110,12 @@ void FilterPrimitive::set_subregion(SVGLength const &x, SVGLength const &y, Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units) { - Geom::OptRect const bb_opt = units.get_item_bbox(); Geom::OptRect const fa_opt = units.get_filter_area(); - Geom::Rect bb; - Geom::Rect fa; - if (!bb_opt || !fa_opt) { + if (!fa_opt) { + std::cerr << "FilterPrimitive::filter_primitive_area: filter area undefined." << std::endl; return Geom::Rect (Geom::Point(0.,0.), Geom::Point(0.,0.)); - } else { - bb = *bb_opt; - fa = *fa_opt; } - + Geom::Rect fa = *fa_opt; // x, y, width, and height are independently defined (i.e. one can be defined, by default, to // the filter area (via default value ) while another is defined relative to the bounding @@ -138,6 +133,14 @@ Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units) if( units.get_primitive_units() == SP_FILTER_UNITS_OBJECTBOUNDINGBOX ) { + Geom::OptRect const bb_opt = units.get_item_bbox(); + if (!bb_opt) { + std::cerr << "FilterPrimitive::filter_primitive_area: bounding box undefined and 'primitiveUnits' is 'objectBoundingBox'." << std::endl; + return Geom::Rect (Geom::Point(0.,0.), Geom::Point(0.,0.)); + } + Geom::Rect bb = *bb_opt; + + // Update computed values for ex, em, %. // For %, assumes primitive unit is objectBoundingBox. // TODO: fetch somehow the object ex and em lengths; 12, 6 are just dummy values. |
