summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a1051b8)
raw | patch | inline | side by side (parent: a1051b8)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 16 Jun 2008 21:25:19 +0000 (21:25 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 16 Jun 2008 21:25:19 +0000 (21:25 +0000) |
src/helper/geom.cpp | patch | blob | history | |
src/helper/geom.h | patch | blob | history | |
src/sp-shape.cpp | patch | blob | history |
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp
index 3917218bbbe0348232710aaf7e1bdcb9ab0f11e1..8a32386fc91f034371be504ccc81ab234da235fd 100644 (file)
--- a/src/helper/geom.cpp
+++ b/src/helper/geom.cpp
* Released under GNU GPL\r
*/\r
\r
+#include "helper/geom.h"\r
+\r
#include <2geom/pathvector.h>\r
#include <2geom/transforms.h>\r
\r
return Geom::bounds_fast(pv * t);\r
}\r
\r
+Geom::Rect\r
+bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t)\r
+{\r
+ return Geom::bounds_exact(pv * t);\r
+}\r
\r
/*\r
Local Variables:\r
diff --git a/src/helper/geom.h b/src/helper/geom.h
index fbc3f2c00c8455d7b92bf4a27a89816734e787ff..d7548756ad3fed5990aedb2ffe25497679e91544 100644 (file)
--- a/src/helper/geom.h
+++ b/src/helper/geom.h
#include <2geom/forward.h>\r
\r
Geom::Rect bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);\r
+Geom::Rect bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);\r
\r
#endif // INKSCAPE_HELPER_GEOM_H\r
\r
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index 4ae2a98f878e5cd3027fc6a985f18e9a0bcce9f6..efed9209b332e62a710e167f81b4efb4e538032a 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-matrix-translate-ops.h>
#include <libnr/nr-scale-matrix-ops.h>
+#include <2geom/rect.h>
+#include "helper/geom.h"
#include <sigc++/functors/ptr_fun.h>
#include <sigc++/adaptors/bind.h>
@@ -637,14 +639,12 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &tr
if (shape->curve) {
NRRect cbbox;
- const_NRBPath bp;
-
- bp.path = SP_CURVE_BPATH (shape->curve);
-
- cbbox.x0 = cbbox.y0 = NR_HUGE;
- cbbox.x1 = cbbox.y1 = -NR_HUGE;
- nr_path_matrix_bbox_union(&bp, transform, &cbbox);
+ Geom::Rect geombbox = bounds_exact_transformed(shape->curve->get_pathvector(), to_2geom(transform));
+ cbbox.x0 = geombbox[0][0];
+ cbbox.y0 = geombbox[1][0];
+ cbbox.x1 = geombbox[0][1];
+ cbbox.y1 = geombbox[1][1];
if ((SPItem::BBoxType) flags != SPItem::GEOMETRIC_BBOX) {