summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-08-06 21:23:19 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-08-06 21:23:19 +0000
commit328d52847188a3c9f24f6ca693c47f0227c82c03 (patch)
tree9b77a0df25a40011883d9f1c7e70a1b80f1ef385 /src
parent2Geom version of the path tests + some additional small changes. (diff)
downloadinkscape-328d52847188a3c9f24f6ca693c47f0227c82c03.tar.gz
inkscape-328d52847188a3c9f24f6ca693c47f0227c82c03.zip
src/helper 2geomified
(bzr r6579)
Diffstat (limited to 'src')
-rw-r--r--src/helper/geom.cpp28
-rw-r--r--src/helper/geom.h3
-rw-r--r--src/helper/pixbuf-ops.cpp20
-rw-r--r--src/helper/png-write.cpp6
4 files changed, 13 insertions, 44 deletions
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp
index bf487f652..caa169a27 100644
--- a/src/helper/geom.cpp
+++ b/src/helper/geom.cpp
@@ -461,34 +461,6 @@ pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, Geom::Mat
}
}
-// temporary wrapper
-void
-pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, NR::Matrix const &m, NR::Point const &pt,
- NR::Rect *bbox, int *wind, NR::Coord *dist,
- NR::Coord tolerance, NR::Rect const *viewbox)
-{
- Geom::Rect _bbox;
- if (bbox)
- _bbox = to_2geom(*bbox);
- Geom::Coord _dist;
- if (dist)
- _dist = *dist;
- Geom::Rect _viewbox;
- if (viewbox)
- _viewbox = to_2geom(*viewbox);
-
- pathv_matrix_point_bbox_wind_distance( pathv, to_2geom(m), to_2geom(pt),
- bbox ? &_bbox : NULL,
- wind,
- dist ? &_dist : NULL,
- tolerance,
- viewbox ? &_viewbox : NULL );
-
- if (bbox)
- *bbox = from_2geom(_bbox);
- if (dist)
- *dist = _dist;
-}
//#################################################################################
/*
diff --git a/src/helper/geom.h b/src/helper/geom.h
index 9b6dd0f35..e4cb38fa7 100644
--- a/src/helper/geom.h
+++ b/src/helper/geom.h
@@ -19,9 +19,6 @@
Geom::Rect bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);
Geom::Rect bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t);
-void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, NR::Matrix const &m, NR::Point const &pt,
- NR::Rect *bbox, int *wind, NR::Coord *dist,
- NR::Coord tolerance, NR::Rect const *viewbox) __attribute__ ((deprecated));
void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, Geom::Matrix const &m, Geom::Point const &pt,
Geom::Rect *bbox, int *wind, Geom::Coord *dist,
Geom::Coord tolerance, Geom::Rect const *viewbox);
diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp
index 5c1a5748a..00ba4508b 100644
--- a/src/helper/pixbuf-ops.cpp
+++ b/src/helper/pixbuf-ops.cpp
@@ -103,26 +103,26 @@ sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/,
sp_document_ensure_up_to_date (doc);
- NR::Rect screen=NR::Rect(NR::Point(x0,y0), NR::Point(x1, y1));
+ Geom::Rect screen=Geom::Rect(Geom::Point(x0,y0), Geom::Point(x1, y1));
double zoom_scale = 1.0;
double padding = 1.0;
- width = (int)ceil(screen.extent(NR::X) * zoom_scale * padding);
- height = (int)ceil(screen.extent(NR::Y) * zoom_scale * padding);
+ width = (int)ceil(screen[Geom::X].extent() * zoom_scale * padding);
+ height = (int)ceil(screen[Geom::Y].extent() * zoom_scale * padding);
- NR::Point origin(screen.min()[NR::X],
- sp_document_height(doc) - screen.extent(NR::Y) - screen.min()[NR::Y]);
+ Geom::Point origin(screen.min()[Geom::X],
+ sp_document_height(doc) - screen[Geom::Y].extent() - screen.min()[Geom::Y]);
- origin[NR::X] = origin[NR::X] + (screen.extent(NR::X) * ((1 - padding) / 2));
- origin[NR::Y] = origin[NR::Y] + (screen.extent(NR::Y) * ((1 - padding) / 2));
+ origin[Geom::X] = origin[Geom::X] + (screen[Geom::X].extent() * ((1 - padding) / 2));
+ origin[Geom::Y] = origin[Geom::Y] + (screen[Geom::Y].extent() * ((1 - padding) / 2));
- NR::scale scale(zoom_scale, zoom_scale);
- NR::Matrix affine = scale * NR::translate(-origin * scale);
+ Geom::Scale scale(zoom_scale, zoom_scale);
+ Geom::Matrix affine = scale * Geom::Translate(-origin * scale);
/* Create ArenaItems and set transform */
NRArenaItem *root = sp_item_invoke_show(SP_ITEM(sp_document_root(doc)), arena, dkey, SP_ITEM_SHOW_DISPLAY);
- nr_arena_item_set_transform(NR_ARENA_ITEM(root), affine);
+ nr_arena_item_set_transform(NR_ARENA_ITEM(root), from_2geom(affine));
NRGC gc(NULL);
gc.transform.set_identity();
diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp
index 69848e9a6..a08f9a939 100644
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
@@ -342,8 +342,8 @@ sp_export_png_file(SPDocument *doc, gchar const *filename,
* (2) a[5] = -a[3] * y1
*/
- NR::Matrix const affine(NR::translate(-x0, -y0)
- * NR::scale(width / (x1 - x0),
+ Geom::Matrix const affine(Geom::Translate(-x0, -y0)
+ * Geom::Scale(width / (x1 - x0),
height / (y1 - y0)));
//SP_PRINT_MATRIX("SVG2PNG", &affine);
@@ -362,7 +362,7 @@ sp_export_png_file(SPDocument *doc, gchar const *filename,
/* Create ArenaItems and set transform */
ebp.root = sp_item_invoke_show(SP_ITEM(sp_document_root(doc)), arena, dkey, SP_ITEM_SHOW_DISPLAY);
- nr_arena_item_set_transform(NR_ARENA_ITEM(ebp.root), affine);
+ nr_arena_item_set_transform(NR_ARENA_ITEM(ebp.root), from_2geom(affine));
// We show all and then hide all items we don't want, instead of showing only requested items,
// because that would not work if the shown item references something in defs