diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2011-02-02 21:24:36 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2011-02-02 21:24:36 +0000 |
| commit | 53933f5fea9d07d1ba6304b88439fba257ee8c34 (patch) | |
| tree | 21f94cd05346fc1236751bb1db3e0850e5aece54 /src/helper | |
| parent | Translations. French translation minor update. (diff) | |
| download | inkscape-53933f5fea9d07d1ba6304b88439fba257ee8c34.tar.gz inkscape-53933f5fea9d07d1ba6304b88439fba257ee8c34.zip | |
update to latest 2geom !
(bzr r10025)
Diffstat (limited to 'src/helper')
| -rw-r--r-- | src/helper/geom.cpp | 32 | ||||
| -rw-r--r-- | src/helper/geom.h | 14 | ||||
| -rw-r--r-- | src/helper/pixbuf-ops.cpp | 2 | ||||
| -rw-r--r-- | src/helper/png-write.cpp | 2 |
4 files changed, 25 insertions, 25 deletions
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp index cc9064451..4bf56f6c1 100644 --- a/src/helper/geom.cpp +++ b/src/helper/geom.cpp @@ -40,8 +40,8 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 { Geom::Coord a, b, c, D; - bbox[0].extendTo(x111); - bbox[1].extendTo(y111); + bbox[0].expandTo(x111); + bbox[1].expandTo(y111); // It already contains (x000,y000) and (x111,y111) // All points of the Bezier lie in the convex hull of (x000,y000), (x001,y001), (x011,y011) and (x111,y111) @@ -83,7 +83,7 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 if ((s > 0.0) && (s < 1.0)) { t = 1.0 - s; xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111; - bbox[0].extendTo(xttt); + bbox[0].expandTo(xttt); } } } else { @@ -97,13 +97,13 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 if ((s > 0.0) && (s < 1.0)) { t = 1.0 - s; xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111; - bbox[0].extendTo(xttt); + bbox[0].expandTo(xttt); } s = (-b - d) / (2 * a); if ((s > 0.0) && (s < 1.0)) { t = 1.0 - s; xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111; - bbox[0].extendTo(xttt); + bbox[0].expandTo(xttt); } } } @@ -122,7 +122,7 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 if ((s > 0.0) && (s < 1.0)) { t = 1.0 - s; yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111; - bbox[1].extendTo(yttt); + bbox[1].expandTo(yttt); } } } else { @@ -136,13 +136,13 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 if ((s > 0.0) && (s < 1.0)) { t = 1.0 - s; yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111; - bbox[1].extendTo(yttt); + bbox[1].expandTo(yttt); } s = (-b - d) / (2 * a); if ((s > 0.0) && (s < 1.0)) { t = 1.0 - s; yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111; - bbox[1].extendTo(yttt); + bbox[1].expandTo(yttt); } } } @@ -150,14 +150,14 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 } Geom::OptRect -bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t) +bounds_fast_transformed(Geom::PathVector const & pv, Geom::Affine const & t) { return bounds_exact_transformed(pv, t); //use this as it is faster for now! :) // return Geom::bounds_fast(pv * t); } Geom::OptRect -bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t) +bounds_exact_transformed(Geom::PathVector const & pv, Geom::Affine const & t) { if (pv.empty()) return Geom::OptRect(); @@ -354,7 +354,7 @@ geom_cubic_bbox_wind_distance (Geom::Coord x000, Geom::Coord y000, } static void -geom_curve_bbox_wind_distance(Geom::Curve const & c, Geom::Matrix const &m, +geom_curve_bbox_wind_distance(Geom::Curve const & c, Geom::Affine const &m, Geom::Point const &pt, Geom::Rect *bbox, int *wind, Geom::Coord *dist, Geom::Coord tolerance, Geom::Rect const *viewbox, @@ -417,7 +417,7 @@ geom_curve_bbox_wind_distance(Geom::Curve const & c, Geom::Matrix const &m, Returns bounding box in *bbox if bbox!=NULL. */ void -pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, Geom::Matrix const &m, Geom::Point const &pt, +pathv_matrix_point_bbox_wind_distance (Geom::PathVector const & pathv, Geom::Affine const &m, Geom::Point const &pt, Geom::Rect *bbox, int *wind, Geom::Coord *dist, Geom::Coord tolerance, Geom::Rect const *viewbox) { @@ -507,7 +507,7 @@ void round_rectangle_outwards(Geom::Rect & rect) { namespace Geom { -bool transform_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coord const epsilon) { +bool transform_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon) { return NR_DF_TEST_CLOSE(m0[0], m1[0], epsilon) && NR_DF_TEST_CLOSE(m0[1], m1[1], epsilon) && @@ -516,12 +516,12 @@ bool transform_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coor } -bool translate_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coord const epsilon) { +bool translate_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon) { return NR_DF_TEST_CLOSE(m0[4], m1[4], epsilon) && NR_DF_TEST_CLOSE(m0[5], m1[5], epsilon); } -bool matrix_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coord const epsilon) { +bool matrix_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon) { return transform_equalp(m0, m1, epsilon) && translate_equalp(m0, m1, epsilon); } @@ -530,7 +530,7 @@ bool matrix_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coord c The following predefined objects are for reference and comparison. */ -Geom::Matrix GEOM_MATRIX_IDENTITY = Geom::identity(); +Geom::Affine GEOM_MATRIX_IDENTITY = Geom::identity(); /* Local Variables: diff --git a/src/helper/geom.h b/src/helper/geom.h index 73f95794f..b1015b185 100644 --- a/src/helper/geom.h +++ b/src/helper/geom.h @@ -16,10 +16,10 @@ #include <libnr/nr-forward.h> #include <libnr/nr-coord.h> -Geom::OptRect bounds_fast_transformed(Geom::PathVector const & pv, Geom::Matrix const & t); -Geom::OptRect bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t); +Geom::OptRect bounds_fast_transformed(Geom::PathVector const & pv, Geom::Affine const & t); +Geom::OptRect bounds_exact_transformed(Geom::PathVector const & pv, Geom::Affine const & t); -void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, Geom::Matrix const &m, Geom::Point const &pt, +void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const & pathv, Geom::Affine const &m, Geom::Point const &pt, Geom::Rect *bbox, int *wind, Geom::Coord *dist, Geom::Coord tolerance, Geom::Rect const *viewbox); @@ -31,12 +31,12 @@ void round_rectangle_outwards(Geom::Rect & rect); The following predefined objects are for reference and comparison. They are defined in helper/geom.cpp */ -extern Geom::Matrix GEOM_MATRIX_IDENTITY; +extern Geom::Affine GEOM_MATRIX_IDENTITY; namespace Geom{ -bool transform_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coord const epsilon); -bool translate_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coord const epsilon); -bool matrix_equalp(Geom::Matrix const &m0, Geom::Matrix const &m1, Geom::Coord const epsilon); +bool transform_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon); +bool translate_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon); +bool matrix_equalp(Geom::Affine const &m0, Geom::Affine const &m1, Geom::Coord const epsilon); } #endif // INKSCAPE_HELPER_GEOM_H diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp index 7ce5c7dd2..acd2568af 100644 --- a/src/helper/pixbuf-ops.cpp +++ b/src/helper/pixbuf-ops.cpp @@ -132,7 +132,7 @@ sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/, origin[Geom::Y] = origin[Geom::Y] + (screen[Geom::Y].extent() * ((1 - padding) / 2)); Geom::Scale scale( (xdpi / PX_PER_IN), (ydpi / PX_PER_IN)); - Geom::Matrix affine = scale * Geom::Translate(-origin * scale); + Geom::Affine affine = scale * Geom::Translate(-origin * scale); /* Create ArenaItems and set transform */ NRArenaItem *root = SP_ITEM(doc->getRoot())->invoke_show( arena, dkey, SP_ITEM_SHOW_DISPLAY); diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index d3fe2771f..2df543c6d 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -442,7 +442,7 @@ sp_export_png_file(SPDocument *doc, gchar const *filename, * (2) a[5] = -a[3] * y1 */ - Geom::Matrix const affine(Geom::Translate(translation) + Geom::Affine const affine(Geom::Translate(translation) * Geom::Scale(width / area.width(), height / area.height())); |
