summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-08-27 09:04:37 +0000
committerKrzysztof Kosinski <tweenk.pl@gmail.com>2011-08-27 09:04:37 +0000
commit72cc39b9f0b340548f395c7f61ca9662b34aea09 (patch)
tree34a0853cff6c6040bc2a0572dfa365280fce2601 /src/live_effects
parentFix "snap guides" toggle (diff)
downloadinkscape-72cc39b9f0b340548f395c7f61ca9662b34aea09.tar.gz
inkscape-72cc39b9f0b340548f395c7f61ca9662b34aea09.zip
Refactor SPItem bounding box methods: remove NRRect usage and make code
using them more obvious. Fix filter region computation. (bzr r10582.1.1)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/lpe-extrude.cpp6
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp4
-rw-r--r--src/live_effects/lpe-rough-hatches.cpp2
-rw-r--r--src/live_effects/lpegroupbbox.cpp2
4 files changed, 8 insertions, 6 deletions
diff --git a/src/live_effects/lpe-extrude.cpp b/src/live_effects/lpe-extrude.cpp
index 96d465569..8b5badf5f 100644
--- a/src/live_effects/lpe-extrude.cpp
+++ b/src/live_effects/lpe-extrude.cpp
@@ -174,10 +174,10 @@ LPEExtrude::resetDefaults(SPItem * item)
using namespace Geom;
- Geom::OptRect bbox = item->getBounds(Geom::identity(), SPItem::GEOMETRIC_BBOX);
+ Geom::OptRect bbox = item->geometricBounds();
if (bbox) {
- Interval boundingbox_X = (*bbox)[Geom::X];
- Interval boundingbox_Y = (*bbox)[Geom::Y];
+ Interval const &boundingbox_X = (*bbox)[Geom::X];
+ Interval const &boundingbox_Y = (*bbox)[Geom::Y];
extrude_vector.set_and_write_new_values( Geom::Point(boundingbox_X.middle(), boundingbox_Y.middle()),
(boundingbox_X.extent() + boundingbox_Y.extent())*Geom::Point(-0.05,0.2) );
}
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index 02d24752b..2d043ca91 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -45,8 +45,10 @@ LPEMirrorSymmetry::doOnApply (SPLPEItem *lpeitem)
{
using namespace Geom;
+ // fixme: what happens if the bbox is empty?
+ // fixme: this is probably wrong
Geom::Affine t = lpeitem->i2dt_affine();
- Geom::Rect bbox = *lpeitem->getBounds(t); // fixme: what happens if getBounds does not return a valid rect?
+ Geom::Rect bbox = *lpeitem->desktopVisualBounds();
Point A(bbox.left(), bbox.bottom());
Point B(bbox.left(), bbox.top());
diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp
index 671d88a8b..87e3dbe5c 100644
--- a/src/live_effects/lpe-rough-hatches.cpp
+++ b/src/live_effects/lpe-rough-hatches.cpp
@@ -557,7 +557,7 @@ LPERoughHatches::resetDefaults(SPItem * item)
{
Effect::resetDefaults(item);
- Geom::OptRect bbox = item->getBounds(Geom::identity(), SPItem::GEOMETRIC_BBOX);
+ Geom::OptRect bbox = item->geometricBounds();
Geom::Point origin(0.,0.);
Geom::Point vector(50.,0.);
if (bbox) {
diff --git a/src/live_effects/lpegroupbbox.cpp b/src/live_effects/lpegroupbbox.cpp
index 382231378..c241b9a4c 100644
--- a/src/live_effects/lpegroupbbox.cpp
+++ b/src/live_effects/lpegroupbbox.cpp
@@ -34,7 +34,7 @@ GroupBBoxEffect::original_bbox(SPLPEItem *lpeitem, bool absolute)
transform = Geom::identity();
}
- Geom::OptRect bbox = lpeitem->getBounds(transform, SPItem::GEOMETRIC_BBOX);
+ Geom::OptRect bbox = lpeitem->geometricBounds(transform);
if (bbox) {
boundingbox_X = (*bbox)[Geom::X];
boundingbox_Y = (*bbox)[Geom::Y];