summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-09-22 16:53:57 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-09-22 16:53:57 +0000
commit8cf510753057485dcf07a5ad4587ffe8c7f7eaa2 (patch)
tree26df259064bee700c6a44df885a990ada2a15612 /src/display
parentUpdate to trunk (diff)
parentFix CMake build (follow-up to r12567) (diff)
downloadinkscape-8cf510753057485dcf07a5ad4587ffe8c7f7eaa2.tar.gz
inkscape-8cf510753057485dcf07a5ad4587ffe8c7f7eaa2.zip
update to trunk
(bzr r11950.1.147)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/drawing-item.cpp19
-rw-r--r--src/display/drawing-item.h1
-rw-r--r--src/display/nr-filter.cpp4
3 files changed, 15 insertions, 9 deletions
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp
index a9836a9e3..1af07cb44 100644
--- a/src/display/drawing-item.cpp
+++ b/src/display/drawing-item.cpp
@@ -281,8 +281,15 @@ DrawingItem::setZOrder(unsigned z)
_markForRendering();
}
-void
-DrawingItem::setItemBounds(Geom::OptRect const &bounds)
+void DrawingItem::setItemBounds(Geom::OptRect const &bounds)
+{
+ if (!bounds) return;
+ Geom::IntRect copy = bounds->roundOutwards();
+ if (_filter) _filter->area_enlarge(copy, this);
+ this->setFilterBounds(copy);
+}
+
+void DrawingItem::setFilterBounds(Geom::OptRect const &bounds)
{
if (bounds) _filter_bbox = bounds;
}
@@ -352,10 +359,10 @@ DrawingItem::update(Geom::IntRect const &area, UpdateContext const &ctx, unsigne
if (to_update & STATE_BBOX) {
// compute drawbox
- if (_filter && render_filters && _bbox) {
- Geom::IntRect newbox(*_bbox);
- _filter->area_enlarge(newbox, this);
- _drawbox = Geom::OptIntRect(newbox);
+ if (_filter && render_filters && _filter_bbox) {
+ Geom::OptRect enlarged = _filter_bbox;
+ *enlarged *= ctm();
+ _drawbox = enlarged->roundOutwards();
} else {
_drawbox = _bbox;
}
diff --git a/src/display/drawing-item.h b/src/display/drawing-item.h
index 8020659db..c69b996b4 100644
--- a/src/display/drawing-item.h
+++ b/src/display/drawing-item.h
@@ -113,6 +113,7 @@ public:
void setMask(DrawingItem *item);
void setZOrder(unsigned z);
void setItemBounds(Geom::OptRect const &bounds);
+ void setFilterBounds(Geom::OptRect const &bounds);
void setKey(unsigned key) { _key = key; }
unsigned key() const { return _key; }
diff --git a/src/display/nr-filter.cpp b/src/display/nr-filter.cpp
index a0103cbb0..c0044c5d8 100644
--- a/src/display/nr-filter.cpp
+++ b/src/display/nr-filter.cpp
@@ -117,9 +117,7 @@ int Filter::render(Inkscape::DrawingItem const *item, DrawingContext &graphic, D
// Get filter are, the filter_effect_area is already done in visualBounds
Geom::OptRect filter_area = item->filterBounds();
// Use the geometricBounds as a backup solution
- if (!filter_area || (filter_area->hasZeroArea() &&
- filter_area->min()[Geom::X] == 0 && filter_area->min()[Geom::Y] == 0))
- filter_area = item->geometricBounds();
+ if (!filter_area) return 1;
FilterUnits units(_filter_units, _primitive_units);
units.set_ctm(trans);