summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2013-09-20 20:27:08 +0000
committerMartin Owens <doctormo@gmail.com>2013-09-20 20:27:08 +0000
commitd332b7a8d0e55612abc377a107bb1768fc657637 (patch)
treeb67ef82509bc254c8dcc8aede2c7f09e0e488d96 /src
parentFix build with dbus api enabled. (diff)
downloadinkscape-d332b7a8d0e55612abc377a107bb1768fc657637.tar.gz
inkscape-d332b7a8d0e55612abc377a107bb1768fc657637.zip
Fix the text filter issue and revert many changes.
(bzr r12556)
Diffstat (limited to 'src')
-rw-r--r--src/display/drawing-item.cpp19
-rw-r--r--src/display/drawing-item.h1
-rw-r--r--src/display/nr-filter.cpp4
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp3
-rw-r--r--src/sp-item.cpp7
5 files changed, 21 insertions, 13 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);
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index f7f910c2f..060cecebf 100644
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -181,8 +181,9 @@ void Layout::show(DrawingGroup *in_arena, Geom::OptRect const &paintbox) const
glyph_index++;
}
nr_text->setStyle(text_source->style);
- nr_text->setItemBounds(paintbox);
in_arena->prependChild(nr_text);
+ // Set item bounds without filter enlargement
+ in_arena->setItemBounds(paintbox);
}
}
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index a91d0e741..b7ef68f7d 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -608,8 +608,8 @@ void SPItem::update(SPCtx *ctx, guint flags) {
Geom::OptRect item_bbox = item->visualBounds();
SPItemView *itemview = item->display;
do {
- if (itemview->arenaitem)
- itemview->arenaitem->setItemBounds(item_bbox);
+ if (itemview->arenaitem) // Already enlarged by visualBounds
+ itemview->arenaitem->setFilterBounds(item_bbox);
} while ( (itemview = itemview->next) );
}
@@ -1065,7 +1065,8 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned
item_bbox = visualBounds();
}
ai->setData(this);
- ai->setItemBounds(item_bbox);
+ // Already enlarged by visualBounds for filters
+ ai->setFilterBounds(item_bbox);
}
return ai;