From 30884b9e814d7baaa2299803e8cb76cf203ca084 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Wed, 4 Aug 2010 05:45:58 +0200 Subject: Wholesale cruft removal part 1 (bzr r9508.1.44) --- src/selection-chemistry.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index cc153aa71..42cfc0a5f 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -52,10 +52,6 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include "sp-conn-end.h" #include "dropper-context.h" #include -#include "libnr/nr-matrix-rotate-ops.h" -#include "libnr/nr-matrix-translate-ops.h" -#include "libnr/nr-scale-ops.h" -#include #include <2geom/transforms.h> #include "xml/repr.h" #include "xml/rebase-hrefs.h" -- cgit v1.2.3 From 498629f82d9453cb7222ab642b867c183fdf1666 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 5 Aug 2010 01:56:47 +0200 Subject: Wholesale cruft removal part 3 (bzr r9508.1.47) --- src/selection-chemistry.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 42cfc0a5f..de2860c8d 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1043,7 +1043,7 @@ take_style_from_item(SPItem *item) } // FIXME: also transform gradient/pattern fills, by forking? NO, this must be nondestructive - double ex = to_2geom(sp_item_i2doc_affine(item)).descrim(); + double ex = sp_item_i2doc_affine(item).descrim(); if (ex != 1.0) { css = sp_css_attr_scale(css, ex); } @@ -2437,7 +2437,7 @@ sp_selection_tile(SPDesktop *desktop, bool apply) gchar const *pat_id = pattern_tile(repr_copies, bounds, doc, ( Geom::Matrix(Geom::Translate(desktop->dt2doc(Geom::Point(r->min()[Geom::X], r->max()[Geom::Y])))) - * to_2geom(parent_transform.inverse()) ), + * parent_transform.inverse() ), parent_transform * move); // restore compensation setting @@ -2447,8 +2447,8 @@ sp_selection_tile(SPDesktop *desktop, bool apply) Inkscape::XML::Node *rect = xml_doc->createElement("svg:rect"); rect->setAttribute("style", g_strdup_printf("stroke:none;fill:url(#%s)", pat_id)); - Geom::Point min = bounds.min() * to_2geom(parent_transform.inverse()); - Geom::Point max = bounds.max() * to_2geom(parent_transform.inverse()); + Geom::Point min = bounds.min() * parent_transform.inverse(); + Geom::Point max = bounds.max() * parent_transform.inverse(); sp_repr_set_svg_double(rect, "width", max[Geom::X] - min[Geom::X]); sp_repr_set_svg_double(rect, "height", max[Geom::Y] - min[Geom::Y]); @@ -2513,7 +2513,7 @@ sp_selection_untile(SPDesktop *desktop) SPPattern *pattern = pattern_getroot(SP_PATTERN(server)); - Geom::Matrix pat_transform = to_2geom(pattern_patternTransform(SP_PATTERN(server))); + Geom::Matrix pat_transform = pattern_patternTransform(SP_PATTERN(server)); pat_transform *= item->transform; for (SPObject *child = sp_object_first_child(SP_OBJECT(pattern)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) { @@ -2635,10 +2635,9 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop) desktop->setWaitingCursor(); // Get the bounding box of the selection - NRRect bbox; sp_document_ensure_up_to_date(document); - selection->bounds(&bbox); - if (NR_RECT_DFLS_TEST_EMPTY(&bbox)) { + Geom::OptRect bbox = selection->bounds(); + if (!bbox) { desktop->clearWaitingCursor(); return; // exceptional situation, so not bother with a translatable error message, just quit quietly } @@ -2691,7 +2690,7 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop) res = prefs_res; } else if (0 < prefs_min) { // If minsize is given, look up minimum bitmap size (default 250 pixels) and calculate resolution from it - res = PX_PER_IN * prefs_min / MIN((bbox.x1 - bbox.x0), (bbox.y1 - bbox.y0)); + res = PX_PER_IN * prefs_min / MIN(bbox->width(), bbox->height()); } else { float hint_xdpi = 0, hint_ydpi = 0; char const *hint_filename; @@ -2712,8 +2711,8 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop) } // The width and height of the bitmap in pixels - unsigned width = (unsigned) floor((bbox.x1 - bbox.x0) * res / PX_PER_IN); - unsigned height =(unsigned) floor((bbox.y1 - bbox.y0) * res / PX_PER_IN); + unsigned width = (unsigned) floor(bbox->width() * res / PX_PER_IN); + unsigned height =(unsigned) floor(bbox->height() * res / PX_PER_IN); // Find out if we have to run an external filter gchar const *run = NULL; @@ -2743,8 +2742,8 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop) Geom::Matrix eek(sp_item_i2d_affine(SP_ITEM(parent_object))); Geom::Matrix t; - double shift_x = bbox.x0; - double shift_y = bbox.y1; + double shift_x = bbox->min()[Geom::X]; + double shift_y = bbox->max()[Geom::Y]; if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid shift_x = round(shift_x); shift_y = -round(-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone @@ -2753,7 +2752,8 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop) // Do the export sp_export_png_file(document, filepath, - bbox.x0, bbox.y0, bbox.x1, bbox.y1, + bbox->min()[Geom::X], bbox->min()[Geom::Y], + bbox->max()[Geom::X], bbox->max()[Geom::Y], width, height, res, res, (guint32) 0xffffff00, NULL, NULL, @@ -2779,8 +2779,8 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop) sp_repr_set_svg_double(repr, "width", width); sp_repr_set_svg_double(repr, "height", height); } else { - sp_repr_set_svg_double(repr, "width", (bbox.x1 - bbox.x0)); - sp_repr_set_svg_double(repr, "height", (bbox.y1 - bbox.y0)); + sp_repr_set_svg_double(repr, "width", bbox->width()); + sp_repr_set_svg_double(repr, "height", bbox->height()); } // Write transform -- cgit v1.2.3 From 263b88617ed6ffbf0d87bb084338cc05e22213aa Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 12 Mar 2011 22:37:15 +0100 Subject: Fix part of bug 733010, where fit page to drawing did not work the same as fit page to selection when all is selected. Fixes page resizing for arrow markers. Infinite line dots markers are still not correctly fit to. Fixed bugs: - https://launchpad.net/bugs/733010 (bzr r10097) --- src/selection-chemistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 5ae4205bb..082c447d0 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3222,7 +3222,7 @@ fit_canvas_to_drawing(SPDocument *doc, bool with_margins) doc->ensureUpToDate(); SPItem const *const root = SP_ITEM(doc->root); - Geom::OptRect const bbox(root->getBounds(root->i2d_affine())); + Geom::OptRect const bbox(root->getBounds(root->i2d_affine(), SPItem::RENDERING_BBOX)); if (bbox) { doc->fitToRect(*bbox, with_margins); return true; -- cgit v1.2.3 From ab5c39d6151762215e0fa7e1bbd159e40bc751ab Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Thu, 17 Mar 2011 20:13:06 +0100 Subject: Linked Offset. Merge branch lp:~ado-papas/inkscape/bug_167419 (Bug #167419, Bug #184341, Bug #239430). (bzr r10109) --- src/selection-chemistry.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 082c447d0..67aba5218 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1379,7 +1379,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons * Same for textpath if we are also doing ANY transform to its path: do not touch textpath, * letters cannot be squeezed or rotated anyway, they only refill the changed path. * Same for linked offset if we are also moving its source: do not move it. */ - if (transform_textpath_with_path || transform_offset_with_source) { + if (transform_textpath_with_path) { // Restore item->transform field from the repr, in case it was changed by seltrans. item->readAttr( "transform" ); } else if (transform_flowtext_with_frame) { @@ -1394,7 +1394,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons } } } - } else if (transform_clone_with_original) { + } else if (transform_clone_with_original || transform_offset_with_source) { // We are transforming a clone along with its original. The below matrix juggling is // necessary to ensure that they transform as a whole, i.e. the clone's induced // transform and its move compensation are both cancelled out. @@ -1408,7 +1408,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons Geom::Affine t_inv = t.inverse(); Geom::Affine result = t_inv * item->transform * t; - if ((prefs_parallel || prefs_unmoved) && affine.isTranslation()) { + if (transform_clone_with_original && (prefs_parallel || prefs_unmoved) && affine.isTranslation()) { // we need to cancel out the move compensation, too // find out the clone move, same as in sp_use_move_compensate @@ -1426,6 +1426,19 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons item->doWriteTransform(item->getRepr(), move, &t, compensate); } + } else if (transform_offset_with_source && (prefs_parallel || prefs_unmoved) && affine.isTranslation()){ + Geom::Affine parent = item->transform; + Geom::Affine offset_move = parent.inverse() * t * parent; + + if (prefs_parallel) { + Geom::Affine move = result * offset_move * t_inv; + item->doWriteTransform(item->getRepr(), move, &move, compensate); + + } else if (prefs_unmoved) { + Geom::Affine move = result * offset_move; + item->doWriteTransform(item->getRepr(), move, &t, compensate); + } + } else { // just apply the result item->doWriteTransform(item->getRepr(), result, &t, compensate); -- cgit v1.2.3 From 3638efba5bec8a6afc9211aa6bbe289767d20b38 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 3 Jun 2011 19:45:55 -0700 Subject: Removed outdated/unsafe SP_DOCUMENT_DEFS macro and reduced usage of SP_ROOT() gtk type function/macro. (bzr r10254) --- src/selection-chemistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 67aba5218..0f756a9a3 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3234,7 +3234,7 @@ fit_canvas_to_drawing(SPDocument *doc, bool with_margins) g_return_val_if_fail(doc != NULL, false); doc->ensureUpToDate(); - SPItem const *const root = SP_ITEM(doc->root); + SPItem const *const root = doc->getRoot(); Geom::OptRect const bbox(root->getBounds(root->i2d_affine(), SPItem::RENDERING_BBOX)); if (bbox) { doc->fitToRect(*bbox, with_margins); -- cgit v1.2.3 From 1079b1b4c0331e5d4bd62f3c93349aec50f520f0 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 23 Jun 2011 18:38:51 +0200 Subject: Update 2Geom to pull in integer rectangle class (bzr r10347.1.1) --- src/selection-chemistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 6f385b8f5..9b88077e7 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -777,7 +777,7 @@ enclose_items(GSList const *items) Geom::OptRect r; for (GSList const *i = items; i; i = i->next) { - r = Geom::unify(r, ((SPItem *) i->data)->getBboxDesktop()); + r.unionWith(((SPItem *) i->data)->getBboxDesktop()); } return r; } -- cgit v1.2.3 From eed6e9c2c229b10911a23976c47da79fc70a5b87 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 17 Jul 2011 21:47:09 +0200 Subject: - rename SPItem::i2d_affine to i2dt_affine, to clarify that it is item-to-desktop, not item-to-document. This should make it easier to spot bugs. - tag some instances where the document-to-desktop transform has been hardcoded (bzr r10466) --- src/selection-chemistry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 9b88077e7..df3eaa388 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1399,7 +1399,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons item->readAttr( "transform" ); // calculate the matrix we need to apply to the clone to cancel its induced transform from its original - Geom::Affine parent2dt = SP_ITEM(item->parent)->i2d_affine(); + Geom::Affine parent2dt = SP_ITEM(item->parent)->i2dt_affine(); Geom::Affine t = parent2dt * affine * parent2dt.inverse(); Geom::Affine t_inv = t.inverse(); Geom::Affine result = t_inv * item->transform * t; @@ -1442,7 +1442,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons } else { if (set_i2d) { - item->set_i2d_affine(item->i2d_affine() * (Geom::Affine)affine); + item->set_i2d_affine(item->i2dt_affine() * (Geom::Affine)affine); } item->doWriteTransform(item->getRepr(), item->transform, NULL, compensate); } @@ -2248,8 +2248,8 @@ sp_select_clone_original(SPDesktop *desktop) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool highlight = prefs->getBool("/options/highlightoriginal/value"); if (highlight) { - Geom::OptRect a = item->getBounds(item->i2d_affine()); - Geom::OptRect b = original->getBounds(original->i2d_affine()); + Geom::OptRect a = item->getBounds(item->i2dt_affine()); + Geom::OptRect b = original->getBounds(original->i2dt_affine()); if ( a && b ) { // draw a flashing line between the objects SPCurve *curve = new SPCurve(); @@ -2766,7 +2766,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) } // Calculate the matrix that will be applied to the image so that it exactly overlaps the source objects - Geom::Affine eek(SP_ITEM(parent_object)->i2d_affine()); + Geom::Affine eek(SP_ITEM(parent_object)->i2dt_affine()); Geom::Affine t; double shift_x = bbox->min()[Geom::X]; @@ -2775,7 +2775,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) shift_x = round(shift_x); shift_y = -round(-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone } - t = Geom::Scale(1, -1) * Geom::Translate(shift_x, shift_y) * eek.inverse(); + t = Geom::Scale(1, -1) * Geom::Translate(shift_x, shift_y) * eek.inverse(); /// @fixme hardcoded doc2dt transform? // Do the export sp_export_png_file(document, filepath, @@ -3231,7 +3231,7 @@ fit_canvas_to_drawing(SPDocument *doc, bool with_margins) doc->ensureUpToDate(); SPItem const *const root = doc->getRoot(); - Geom::OptRect const bbox(root->getBounds(root->i2d_affine(), SPItem::RENDERING_BBOX)); + Geom::OptRect const bbox(root->getBounds(root->i2dt_affine(), SPItem::RENDERING_BBOX)); if (bbox) { doc->fitToRect(*bbox, with_margins); return true; -- cgit v1.2.3 From e24a1e86c4d4cdf272e3ec0cd33b31bf2d59244c Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Wed, 20 Jul 2011 01:01:23 +0200 Subject: Remove deprecated Glib symbols Fixed bugs: - https://launchpad.net/bugs/367606 (bzr r10480) --- src/selection-chemistry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index df3eaa388..23991bfb6 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2691,14 +2691,15 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) g_strcanon(basename, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.=+~$#@^&!?", '_'); // Build the complete path by adding document base dir, if set, otherwise home dir - gchar * directory = NULL; + gchar *directory = NULL; if ( document->getURI() ) { - directory = g_dirname( document->getURI() ); + directory = g_path_get_dirname( document->getURI() ); } if (directory == NULL) { directory = homedir_path(NULL); } gchar *filepath = g_build_filename(directory, basename, NULL); + g_free(directory); //g_print("%s\n", filepath); -- cgit v1.2.3 From 72cc39b9f0b340548f395c7f61ca9662b34aea09 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 11:04:37 +0200 Subject: Refactor SPItem bounding box methods: remove NRRect usage and make code using them more obvious. Fix filter region computation. (bzr r10582.1.1) --- src/selection-chemistry.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 23991bfb6..75745f4af 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -777,7 +777,7 @@ enclose_items(GSList const *items) Geom::OptRect r; for (GSList const *i = items; i; i = i->next) { - r.unionWith(((SPItem *) i->data)->getBboxDesktop()); + r.unionWith(((SPItem *) i->data)->desktopVisualBounds()); } return r; } @@ -829,7 +829,7 @@ sp_selection_raise(SPDesktop *desktop) for (SPObject *newref = child->next; newref; newref = newref->next) { // if the sibling is an item AND overlaps our selection, if (SP_IS_ITEM(newref)) { - Geom::OptRect newref_bbox = SP_ITEM(newref)->getBboxDesktop(); + Geom::OptRect newref_bbox = SP_ITEM(newref)->desktopVisualBounds(); if ( newref_bbox && selected->intersects(*newref_bbox) ) { // AND if it's not one of our selected objects, if (!g_slist_find((GSList *) items, newref)) { @@ -924,7 +924,7 @@ sp_selection_lower(SPDesktop *desktop) for (SPObject *newref = prev_sibling(child); newref; newref = prev_sibling(newref)) { // if the sibling is an item AND overlaps our selection, if (SP_IS_ITEM(newref)) { - Geom::OptRect ref_bbox = SP_ITEM(newref)->getBboxDesktop(); + Geom::OptRect ref_bbox = SP_ITEM(newref)->desktopVisualBounds(); if ( ref_bbox && selected->intersects(*ref_bbox) ) { // AND if it's not one of our selected objects, if (!g_slist_find((GSList *) items, newref)) { @@ -1481,7 +1481,7 @@ sp_selection_scale_absolute(Inkscape::Selection *selection, if (selection->isEmpty()) return; - Geom::OptRect const bbox(selection->bounds()); + Geom::OptRect bbox = selection->visualBounds(); if ( !bbox ) { return; } @@ -1503,7 +1503,7 @@ void sp_selection_scale_relative(Inkscape::Selection *selection, Geom::Point con if (selection->isEmpty()) return; - Geom::OptRect const bbox(selection->bounds()); + Geom::OptRect bbox = selection->visualBounds(); if ( !bbox ) { return; @@ -1621,7 +1621,7 @@ sp_selection_rotate_screen(Inkscape::Selection *selection, gdouble angle) if (selection->isEmpty()) return; - Geom::OptRect const bbox(selection->bounds()); + Geom::OptRect bbox = selection->visualBounds(); boost::optional center = selection->center(); if ( !bbox || !center ) { @@ -1650,7 +1650,7 @@ sp_selection_scale(Inkscape::Selection *selection, gdouble grow) if (selection->isEmpty()) return; - Geom::OptRect const bbox(selection->bounds()); + Geom::OptRect bbox = selection->visualBounds(); if (!bbox) { return; } @@ -1687,7 +1687,7 @@ sp_selection_scale_times(Inkscape::Selection *selection, gdouble times) if (selection->isEmpty()) return; - Geom::OptRect sel_bbox = selection->bounds(); + Geom::OptRect sel_bbox = selection->visualBounds(); if (!sel_bbox) { return; @@ -2014,7 +2014,7 @@ SPItem *next_item(SPDesktop *desktop, GSList *path, SPObject *root, void scroll_to_show_item(SPDesktop *desktop, SPItem *item) { Geom::Rect dbox = desktop->get_display_area(); - Geom::OptRect sbox = item->getBboxDesktop(); + Geom::OptRect sbox = item->desktopVisualBounds(); if ( sbox && dbox.contains(*sbox) == false ) { Geom::Point const s_dt = sbox->midpoint(); @@ -2248,8 +2248,8 @@ sp_select_clone_original(SPDesktop *desktop) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool highlight = prefs->getBool("/options/highlightoriginal/value"); if (highlight) { - Geom::OptRect a = item->getBounds(item->i2dt_affine()); - Geom::OptRect b = original->getBounds(original->i2dt_affine()); + Geom::OptRect a = item->desktopVisualBounds(); + Geom::OptRect b = original->desktopVisualBounds(); if ( a && b ) { // draw a flashing line between the objects SPCurve *curve = new SPCurve(); @@ -2291,7 +2291,7 @@ void sp_selection_to_marker(SPDesktop *desktop, bool apply) } doc->ensureUpToDate(); - Geom::OptRect r = selection->bounds(SPItem::RENDERING_BBOX); + Geom::OptRect r = selection->visualBounds(); boost::optional c = selection->center(); if ( !r || !c ) { return; @@ -2322,7 +2322,7 @@ void sp_selection_to_marker(SPDesktop *desktop, bool apply) repr_copies = g_slist_prepend(repr_copies, dup); } - Geom::Rect bounds(desktop->dt2doc(r->min()), desktop->dt2doc(r->max())); + Geom::Rect bbox(desktop->dt2doc(r->min()), desktop->dt2doc(r->max())); if (apply) { // delete objects so that their clones don't get alerted; this object will be restored shortly @@ -2339,7 +2339,7 @@ void sp_selection_to_marker(SPDesktop *desktop, bool apply) int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED); prefs->setInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED); - gchar const *mark_id = generate_marker(repr_copies, bounds, doc, + gchar const *mark_id = generate_marker(repr_copies, bbox, doc, ( Geom::Affine(Geom::Translate(desktop->dt2doc( Geom::Point(r->min()[Geom::X], r->max()[Geom::Y])))) @@ -2416,7 +2416,7 @@ sp_selection_tile(SPDesktop *desktop, bool apply) } doc->ensureUpToDate(); - Geom::OptRect r = selection->bounds(SPItem::RENDERING_BBOX); + Geom::OptRect r = selection->visualBounds(); if ( !r ) { return; } @@ -2447,7 +2447,7 @@ sp_selection_tile(SPDesktop *desktop, bool apply) // restore the z-order after prepends repr_copies = g_slist_reverse(repr_copies); - Geom::Rect bounds(desktop->dt2doc(r->min()), desktop->dt2doc(r->max())); + Geom::Rect bbox(desktop->dt2doc(r->min()), desktop->dt2doc(r->max())); if (apply) { // delete objects so that their clones don't get alerted; this object will be restored shortly @@ -2464,7 +2464,7 @@ sp_selection_tile(SPDesktop *desktop, bool apply) int saved_compensation = prefs->getInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED); prefs->setInt("/options/clonecompensation/value", SP_CLONE_COMPENSATION_UNMOVED); - gchar const *pat_id = pattern_tile(repr_copies, bounds, doc, + gchar const *pat_id = pattern_tile(repr_copies, bbox, doc, ( Geom::Affine(Geom::Translate(desktop->dt2doc(Geom::Point(r->min()[Geom::X], r->max()[Geom::Y])))) * parent_transform.inverse() ), @@ -2477,8 +2477,8 @@ sp_selection_tile(SPDesktop *desktop, bool apply) Inkscape::XML::Node *rect = xml_doc->createElement("svg:rect"); rect->setAttribute("style", g_strdup_printf("stroke:none;fill:url(#%s)", pat_id)); - Geom::Point min = bounds.min() * parent_transform.inverse(); - Geom::Point max = bounds.max() * parent_transform.inverse(); + Geom::Point min = bbox.min() * parent_transform.inverse(); + Geom::Point max = bbox.max() * parent_transform.inverse(); sp_repr_set_svg_double(rect, "width", max[Geom::X] - min[Geom::X]); sp_repr_set_svg_double(rect, "height", max[Geom::Y] - min[Geom::Y]); @@ -2663,7 +2663,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) // Get the bounding box of the selection document->ensureUpToDate(); - Geom::OptRect bbox = selection->bounds(); + Geom::OptRect bbox = selection->visualBounds(); if (!bbox) { desktop->clearWaitingCursor(); return; // exceptional situation, so not bother with a translatable error message, just quit quietly @@ -3200,7 +3200,7 @@ fit_canvas_to_selection(SPDesktop *desktop, bool with_margins) desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to fit canvas to.")); return false; } - Geom::OptRect const bbox(desktop->selection->bounds(SPItem::RENDERING_BBOX)); + Geom::OptRect const bbox(desktop->selection->visualBounds()); if (bbox) { doc->fitToRect(*bbox, with_margins); return true; @@ -3232,7 +3232,7 @@ fit_canvas_to_drawing(SPDocument *doc, bool with_margins) doc->ensureUpToDate(); SPItem const *const root = doc->getRoot(); - Geom::OptRect const bbox(root->getBounds(root->i2dt_affine(), SPItem::RENDERING_BBOX)); + Geom::OptRect bbox = root->desktopVisualBounds(); if (bbox) { doc->fitToRect(*bbox, with_margins); return true; -- cgit v1.2.3 From d6af1140ee108cc7d7fb6e0ba89ff7e30bb7ad3a Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 18:05:32 +0200 Subject: Completely remove NRRect, NRRectL, in-svg-plane.h (bzr r10582.1.6) --- src/selection-chemistry.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 75745f4af..4c3c0f197 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -85,7 +85,6 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include "sp-filter-reference.h" #include "gradient-drag.h" #include "uri-references.h" -#include "libnr/nr-convert2geom.h" #include "display/curve.h" #include "display/canvas-bpath.h" #include "inkscape-private.h" -- cgit v1.2.3 From 20097d47e6945bceb57d2335d23fe764f493ab59 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 2 Oct 2011 20:44:17 -0700 Subject: Another minor pass of Doxygen cleanup. (bzr r10659) --- src/selection-chemistry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 4c3c0f197..b5919dd71 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1,5 +1,5 @@ /** @file - * @brief Miscellanous operations on selected items + * Miscellanous operations on selected items. */ /* Authors: * Lauris Kaplinski @@ -1554,7 +1554,7 @@ void sp_selection_move_relative(Inkscape::Selection *selection, double dx, doubl } /** - * @brief Rotates selected objects 90 degrees, either clock-wise or counter-clockwise, depending on the value of ccw + * Rotates selected objects 90 degrees, either clock-wise or counter-clockwise, depending on the value of ccw. */ void sp_selection_rotate_90(SPDesktop *desktop, bool ccw) { @@ -2841,7 +2841,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) } /** - * \brief Creates a mask or clipPath from selection + * Creates a mask or clipPath from selection. * Two different modes: * if applyToLayer, all selection is moved to DEFS as mask/clippath * and is applied to current layer -- cgit v1.2.3