diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-08-08 17:32:43 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-08-08 17:32:43 +0000 |
| commit | 43dc21b53e642208542398d7d257d0f9cb48582f (patch) | |
| tree | 75510653a1989316dad1df9b3d9bc9230264281c /src/dialogs | |
| parent | Fixed svg-path (and display/curve) tests to properly handle closepath and mad... (diff) | |
| download | inkscape-43dc21b53e642208542398d7d257d0f9cb48582f.tar.gz inkscape-43dc21b53e642208542398d7d257d0f9cb48582f.zip | |
remove many unnecessary to_2geom and from_2geom calls
(bzr r6593)
Diffstat (limited to 'src/dialogs')
| -rw-r--r-- | src/dialogs/clonetiler.cpp | 2 | ||||
| -rw-r--r-- | src/dialogs/export.cpp | 2 | ||||
| -rw-r--r-- | src/dialogs/stroke-style.cpp | 2 | ||||
| -rw-r--r-- | src/dialogs/tiledialog.cpp | 18 | ||||
| -rw-r--r-- | src/dialogs/unclump.cpp | 12 |
5 files changed, 18 insertions, 18 deletions
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index 07b146fca..048635bb9 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -1242,7 +1242,7 @@ clonetiler_apply( GtkWidget */*widget*/, void * ) int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0); SPItem::BBoxType bbox_type = (prefs_bbox ==0)? SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX; - boost::optional<NR::Rect> r = SP_ITEM(obj)->getBounds(from_2geom(sp_item_i2doc_affine(SP_ITEM(obj))), + boost::optional<NR::Rect> r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)), bbox_type); if (r) { w = r->dimensions()[NR::X]; diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp index bd4493eae..ddf62f371 100644 --- a/src/dialogs/export.cpp +++ b/src/dialogs/export.cpp @@ -1106,7 +1106,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base) } NRRect area; - sp_item_invoke_bbox(item, &area, from_2geom(sp_item_i2r_affine((SPItem *) item)), TRUE); + sp_item_invoke_bbox(item, &area, sp_item_i2r_affine((SPItem *) item), TRUE); gint width = (gint) ((area.x1 - area.x0) * dpi / PX_PER_IN + 0.5); gint height = (gint) ((area.y1 - area.y0) * dpi / PX_PER_IN + 0.5); diff --git a/src/dialogs/stroke-style.cpp b/src/dialogs/stroke-style.cpp index ae387e5f8..373ee5832 100644 --- a/src/dialogs/stroke-style.cpp +++ b/src/dialogs/stroke-style.cpp @@ -615,7 +615,7 @@ sp_marker_prev_new(unsigned psize, gchar const *mname, // Find object's bbox in document Geom::Matrix const i2doc(sp_item_i2doc_affine(SP_ITEM(object))); - boost::optional<NR::Rect> dbox = SP_ITEM(object)->getBounds(from_2geom(i2doc)); + boost::optional<NR::Rect> dbox = SP_ITEM(object)->getBounds(i2doc); if (!dbox) { return NULL; diff --git a/src/dialogs/tiledialog.cpp b/src/dialogs/tiledialog.cpp index f9bde3c0b..63732df0b 100644 --- a/src/dialogs/tiledialog.cpp +++ b/src/dialogs/tiledialog.cpp @@ -49,8 +49,8 @@ sp_compare_x_position(SPItem *first, SPItem *second) using NR::X; using NR::Y; - boost::optional<NR::Rect> a = first->getBounds(from_2geom(sp_item_i2doc_affine(first))); - boost::optional<NR::Rect> b = second->getBounds(from_2geom(sp_item_i2doc_affine(second))); + boost::optional<NR::Rect> a = first->getBounds(sp_item_i2doc_affine(first)); + boost::optional<NR::Rect> b = second->getBounds(sp_item_i2doc_affine(second)); if ( !a || !b ) { // FIXME? @@ -89,8 +89,8 @@ sp_compare_x_position(SPItem *first, SPItem *second) int sp_compare_y_position(SPItem *first, SPItem *second) { - boost::optional<NR::Rect> a = first->getBounds(from_2geom(sp_item_i2doc_affine(first))); - boost::optional<NR::Rect> b = second->getBounds(from_2geom(sp_item_i2doc_affine(second))); + boost::optional<NR::Rect> a = first->getBounds(sp_item_i2doc_affine(first)); + boost::optional<NR::Rect> b = second->getBounds(sp_item_i2doc_affine(second)); if ( !a || !b ) { // FIXME? @@ -169,7 +169,7 @@ void TileDialog::Grid_Arrange () cnt=0; for (; items != NULL; items = items->next) { SPItem *item = SP_ITEM(items->data); - boost::optional<NR::Rect> b = item->getBounds(from_2geom(sp_item_i2doc_affine(item))); + boost::optional<NR::Rect> b = item->getBounds(sp_item_i2doc_affine(item)); if (!b) { continue; } @@ -211,7 +211,7 @@ void TileDialog::Grid_Arrange () const GSList *sizes = sorted; for (; sizes != NULL; sizes = sizes->next) { SPItem *item = SP_ITEM(sizes->data); - boost::optional<NR::Rect> b = item->getBounds(from_2geom(sp_item_i2doc_affine(item))); + boost::optional<NR::Rect> b = item->getBounds(sp_item_i2doc_affine(item)); if (b) { width = b->dimensions()[NR::X]; height = b->dimensions()[NR::Y]; @@ -318,7 +318,7 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h for (; current_row != NULL; current_row = current_row->next) { SPItem *item=SP_ITEM(current_row->data); Inkscape::XML::Node *repr = SP_OBJECT_REPR(item); - boost::optional<NR::Rect> b = item->getBounds(from_2geom(sp_item_i2doc_affine(item))); + boost::optional<NR::Rect> b = item->getBounds(sp_item_i2doc_affine(item)); NR::Point min; if (b) { width = b->dimensions()[NR::X]; @@ -337,8 +337,8 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h // signs are inverted between x and y due to y inversion NR::Point move = NR::Point(new_x - min[NR::X], min[NR::Y] - new_y); - NR::Matrix const &affine = NR::Matrix(NR::translate(move)); - sp_item_set_i2d_affine(item, sp_item_i2d_affine(item) * to_2geom(affine)); + Geom::Matrix const affine = Geom::Matrix(Geom::Translate(move)); + sp_item_set_i2d_affine(item, sp_item_i2d_affine(item) * affine); sp_item_write_transform(item, repr, item->transform, NULL); SP_OBJECT (current_row->data)->updateRepr(); cnt +=1; diff --git a/src/dialogs/unclump.cpp b/src/dialogs/unclump.cpp index 923c44add..77c18aa64 100644 --- a/src/dialogs/unclump.cpp +++ b/src/dialogs/unclump.cpp @@ -35,7 +35,7 @@ unclump_center (SPItem *item) return i->second; } - boost::optional<NR::Rect> r = item->getBounds(from_2geom(sp_item_i2d_affine(item))); + boost::optional<NR::Rect> r = item->getBounds(sp_item_i2d_affine(item)); if (r) { NR::Point const c = r->midpoint(); c_cache[SP_OBJECT_ID(item)] = c; @@ -54,7 +54,7 @@ unclump_wh (SPItem *item) if ( i != wh_cache.end() ) { wh = i->second; } else { - boost::optional<NR::Rect> r = item->getBounds(from_2geom(sp_item_i2d_affine(item))); + boost::optional<NR::Rect> r = item->getBounds(sp_item_i2d_affine(item)); if (r) { wh = r->dimensions(); wh_cache[SP_OBJECT_ID(item)] = wh; @@ -289,7 +289,7 @@ unclump_push (SPItem *from, SPItem *what, double dist) NR::Point p = unclump_center (from); NR::Point by = dist * NR::unit_vector (- (p - it)); - NR::Matrix move = NR::Matrix (NR::translate (by)); + Geom::Matrix move = Geom::Translate (by); std::map<const gchar *, NR::Point>::iterator i = c_cache.find(SP_OBJECT_ID(what)); if ( i != c_cache.end() ) { @@ -298,7 +298,7 @@ unclump_push (SPItem *from, SPItem *what, double dist) //g_print ("push %s at %g,%g from %g,%g by %g,%g, dist %g\n", SP_OBJECT_ID(what), it[NR::X],it[NR::Y], p[NR::X],p[NR::Y], by[NR::X],by[NR::Y], dist); - sp_item_set_i2d_affine(what, sp_item_i2d_affine(what) * to_2geom(move)); + sp_item_set_i2d_affine(what, sp_item_i2d_affine(what) * move); sp_item_write_transform(what, SP_OBJECT_REPR(what), what->transform, NULL); } @@ -312,7 +312,7 @@ unclump_pull (SPItem *to, SPItem *what, double dist) NR::Point p = unclump_center (to); NR::Point by = dist * NR::unit_vector (p - it); - NR::Matrix move = NR::Matrix (NR::translate (by)); + Geom::Matrix move = Geom::Translate (by); std::map<const gchar *, NR::Point>::iterator i = c_cache.find(SP_OBJECT_ID(what)); if ( i != c_cache.end() ) { @@ -321,7 +321,7 @@ unclump_pull (SPItem *to, SPItem *what, double dist) //g_print ("pull %s at %g,%g to %g,%g by %g,%g, dist %g\n", SP_OBJECT_ID(what), it[NR::X],it[NR::Y], p[NR::X],p[NR::Y], by[NR::X],by[NR::Y], dist); - sp_item_set_i2d_affine(what, sp_item_i2d_affine(what) * to_2geom(move)); + sp_item_set_i2d_affine(what, sp_item_i2d_affine(what) * move); sp_item_write_transform(what, SP_OBJECT_REPR(what), what->transform, NULL); } |
