From 0459094999e0298341ecad677464043528d1036f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 9 May 2012 00:54:48 -0700 Subject: Centralized line creation and enhanced visibility. (bzr r11350) --- src/seltrans.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index ca190e5ad..f480a4824 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -46,11 +46,13 @@ #include "mod360.h" #include <2geom/angle.h> #include "display/snap-indicator.h" +#include "ui/control-manager.h" #if !GTK_CHECK_VERSION(2,22,0) #include "compat-key-syms.h" #endif +using Inkscape::ControlManager; using Inkscape::DocumentUndo; static void sp_remove_handles(SPKnot *knot[], gint num); @@ -157,7 +159,7 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : sp_canvas_item_hide(_norm); for (int i = 0; i < 4; i++) { - _l[i] = SP_CTRLLINE(sp_canvas_item_new(sp_desktop_controls(desktop), SP_TYPE_CTRLLINE, NULL)); + _l[i] = ControlManager::getManager().createControlLine(sp_desktop_controls(desktop)); sp_canvas_item_hide(_l[i]); } -- cgit v1.2.3 From c21611294dea99e78017f770feb78684573cce89 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Tue, 5 Jun 2012 13:34:43 +0100 Subject: Header cleaning for GTK+3 migration (bzr r11460) --- src/seltrans.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index f480a4824..4b0ef284b 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -41,6 +41,7 @@ #include "verbs.h" #include #include "display/sp-ctrlline.h" +#include "display/sodipodi-ctrl.h" #include "preferences.h" #include "xml/repr.h" #include "mod360.h" -- cgit v1.2.3 From 62dd6c138e3547689acdcccbb289d822b458cdb0 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 9 Jun 2012 14:40:09 +0100 Subject: Stop deriving SPCanvasItem from GtkObject (bzr r11469.1.1) --- src/seltrans.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 4b0ef284b..88a4a536d 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -196,16 +196,16 @@ Inkscape::SelTrans::~SelTrans() } if (_norm) { - gtk_object_destroy(GTK_OBJECT(_norm)); + sp_canvas_item_destroy(_norm); _norm = NULL; } if (_grip) { - gtk_object_destroy(GTK_OBJECT(_grip)); + sp_canvas_item_destroy(_grip); _grip = NULL; } for (int i = 0; i < 4; i++) { if (_l[i]) { - gtk_object_destroy(_l[i]); + sp_canvas_item_destroy(_l[i]); _l[i] = NULL; } } -- cgit v1.2.3 From 9abd33133650d77714fccf09d0c9ff27c9b75a78 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 5 Jul 2012 22:39:08 +0100 Subject: Drop GTK+ 2.20 support. Fixed bugs: - https://launchpad.net/bugs/1020494 (bzr r11529) --- src/seltrans.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 88a4a536d..15cea9198 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -49,10 +49,6 @@ #include "display/snap-indicator.h" #include "ui/control-manager.h" -#if !GTK_CHECK_VERSION(2,22,0) -#include "compat-key-syms.h" -#endif - using Inkscape::ControlManager; using Inkscape::DocumentUndo; -- cgit v1.2.3 From d0d3e7f80dafc80e47c9a95bf31c14283010a2c2 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 8 Dec 2012 21:29:18 +0100 Subject: Selector tool: improve responsiveness for snapping a path's internal intersections (was unbearable already for paths having 20+ segments) (bzr r11937) --- src/seltrans.cpp | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 15cea9198..64bb95508 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -298,30 +298,21 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s // Next, get all points to consider for snapping SnapManager const &m = _desktop->namedview->snap_manager; _snap_points.clear(); - _snap_points = selection->getSnapPoints(&m.snapprefs); - std::vector snap_points_hull = selection->getSnapPointsConvexHull(&m.snapprefs); + if (m.someSnapperMightSnap(false)) { // Only search for snap sources when really needed, to avoid unnecessary delays + _snap_points = selection->getSnapPoints(&m.snapprefs); // This might take some time! + } if (_snap_points.size() > 200 && !(prefs->getBool("/options/snapclosestonly/value", false))) { /* Snapping a huge number of nodes will take way too long, so limit the number of snappable nodes A typical user would rarely ever try to snap such a large number of nodes anyway, because (s)he would hardly be able to discern which node would be snapping */ - _snap_points = snap_points_hull; - //} + _snap_points.resize(200); // Unfortunately, by now we will have lost the font-baseline snappoints :-( } // Find bbox hulling all special points, which excludes stroke width. Here we need to include the // path nodes, for example because a rectangle which has been converted to a path doesn't have // any other special points - Geom::Rect snap_points_bbox; - if ( snap_points_hull.empty() == false ) { - std::vector::iterator i = snap_points_hull.begin(); - snap_points_bbox = Geom::Rect((*i).getPoint(), (*i).getPoint()); - i++; - while (i != snap_points_hull.end()) { - snap_points_bbox.expandTo((*i).getPoint()); - i++; - } - } + Geom::OptRect snap_points_bbox = selection->bounds(SPItem::GEOMETRIC_BBOX); _bbox_points.clear(); // Collect the bounding box's corners and midpoints for each selected item @@ -329,11 +320,8 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s bool c = m.snapprefs.isTargetSnappable(SNAPTARGET_BBOX_CORNER); bool mp = m.snapprefs.isTargetSnappable(SNAPTARGET_BBOX_MIDPOINT); bool emp = m.snapprefs.isTargetSnappable(SNAPTARGET_BBOX_EDGE_MIDPOINT); - // 1) Preferably we'd use the bbox of each selected item, instead of the bbox of the selection as a whole; for translations - // this is easy to do, but when snapping the visual bbox while scaling we will have to compensate for the scaling of the - // stroke width. (see get_scale_transform_for_stroke()). This however is currently only implemented for a single bbox. - // 2) More than 50 items will produce at least 200 bbox points, which might make Inkscape crawl - // (see the comment a few lines above). In that case we will use the bbox of the selection as a whole + // Preferably we'd use the bbox of each selected item, but for example 50 items will produce at least 200 bbox points, + // which might make Inkscape crawl(see the comment a few lines above). In that case we will use the bbox of the selection as a whole bool c1 = (_items.size() > 0) && (_items.size() < 50); bool c2 = prefs->getBool("/options/snapclosestonly/value", false); if (translating && (c1 || c2)) { @@ -353,10 +341,14 @@ void Inkscape::SelTrans::grab(Geom::Point const &p, gdouble x, gdouble y, bool s // - one for snapping the boundingbox, which can be either visual or geometric // - one for snapping the special points // The "opposite" in case of a geometric boundingbox always coincides with the "opposite" for the special points - // These distinct "opposites" are needed in the snapmanager to avoid bugs such as #sf1540195 (in which + // These distinct "opposites" are needed in the snapmanager to avoid bugs such as LP167905 (in which // a box is caught between two guides) _opposite_for_bboxpoints = _bbox->min() + _bbox->dimensions() * Geom::Scale(1-x, 1-y); - _opposite_for_specpoints = snap_points_bbox.min() + snap_points_bbox.dimensions() * Geom::Scale(1-x, 1-y); + if (snap_points_bbox) { + _opposite_for_specpoints = (*snap_points_bbox).min() + (*snap_points_bbox).dimensions() * Geom::Scale(1-x, 1-y); + } else { + _opposite_for_specpoints = _opposite_for_bboxpoints; + } _opposite = _opposite_for_bboxpoints; } -- cgit v1.2.3 From 5ebf0c12c2b1be530bf4742236768a55e549494b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 27 Jan 2013 14:19:11 +0000 Subject: Migrate ruler position tracking to new track_widget API Fixed bugs: - https://launchpad.net/bugs/1105504 (bzr r12067) --- src/seltrans.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 64bb95508..b6c6baaf7 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -813,8 +813,6 @@ gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, Geom::Point *position, return TRUE; } - knot->desktop->setPosition(*position); - // When holding shift while rotating or skewing, the transformation will be // relative to the point opposite of the handle; otherwise it will be relative // to the center as set for the selection -- cgit v1.2.3 From bf463fba185a4e67d25efe324a577cf89dcdce5f Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 12 May 2013 14:36:06 +0200 Subject: Fix for Bug #448872 (Changing the bounding box type in preferences does not update the preview) by Vinipsmaker. Fixed bugs: - https://launchpad.net/bugs/448872 (bzr r12329) --- src/seltrans.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index b6c6baaf7..84c73e452 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -86,6 +86,17 @@ static gboolean sp_seltrans_handle_event(SPKnot *knot, GdkEvent *event, gpointer return FALSE; } +Inkscape::SelTrans::BoundingBoxPrefsObserver::BoundingBoxPrefsObserver(SelTrans &sel_trans) : + Observer("/tools/bounding_box"), + _sel_trans(sel_trans) +{ +} + +void Inkscape::SelTrans::BoundingBoxPrefsObserver::notify(Preferences::Entry const &val) +{ + _sel_trans._boundingBoxPrefsChanged(static_cast(val.getBool())); +} + Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : _desktop(desktop), _selcue(desktop), @@ -103,7 +114,8 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : _origin_for_bboxpoints(Geom::Point(0,0)), _chandle(NULL), _stamp_cache(NULL), - _message_context(desktop->messageStack()) + _message_context(desktop->messageStack()), + _bounding_box_prefs_observer(*this) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int prefs_bbox = prefs->getBool("/tools/bounding_box"); @@ -169,6 +181,8 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : ); _all_snap_sources_iter = _all_snap_sources_sorted.end(); + + prefs->addObserver(_bounding_box_prefs_observer); } Inkscape::SelTrans::~SelTrans() @@ -873,6 +887,15 @@ void Inkscape::SelTrans::_selModified(Inkscape::Selection */*selection*/, guint } } +void Inkscape::SelTrans::_boundingBoxPrefsChanged(int prefs_bbox) +{ + _snap_bbox_type = !prefs_bbox ? + SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX; + + _updateVolatileState(); + _updateHandles(); +} + /* * handlers for handle move-request */ -- cgit v1.2.3 From 4d9cb756267d624666ae792d621a255f4b209657 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 1 Jul 2013 22:23:13 -0400 Subject: Refactor resize, rotate, skew handle code (bzr r12400) --- src/seltrans.cpp | 287 ++++++++++++++++++++----------------------------------- 1 file changed, 104 insertions(+), 183 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 84c73e452..016eba816 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -48,12 +48,11 @@ #include <2geom/angle.h> #include "display/snap-indicator.h" #include "ui/control-manager.h" +#include "seltrans-handles.h" using Inkscape::ControlManager; using Inkscape::DocumentUndo; -static void sp_remove_handles(SPKnot *knot[], gint num); - static void sp_sel_trans_handle_grab(SPKnot *knot, guint state, gpointer data); static void sp_sel_trans_handle_ungrab(SPKnot *knot, guint state, gpointer data); static void sp_sel_trans_handle_click(SPKnot *knot, guint state, gpointer data); @@ -62,7 +61,7 @@ static gboolean sp_sel_trans_handle_request(SPKnot *knot, Geom::Point *p, guint extern GdkPixbuf *handles[]; -static gboolean sp_seltrans_handle_event(SPKnot *knot, GdkEvent *event, gpointer) +static gboolean sp_sel_trans_handle_event(SPKnot *knot, GdkEvent *event, gpointer) { switch (event->type) { case GDK_MOTION_NOTIFY: @@ -112,7 +111,6 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : _opposite_for_bboxpoints(Geom::Point(0,0)), _origin_for_specpoints(Geom::Point(0,0)), _origin_for_bboxpoints(Geom::Point(0,0)), - _chandle(NULL), _stamp_cache(NULL), _message_context(desktop->messageStack()), _bounding_box_prefs_observer(*this) @@ -124,16 +122,12 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) : g_return_if_fail(desktop != NULL); - for (int i = 0; i < 8; i++) { - _shandle[i] = NULL; - _rhandle[i] = NULL; - } - _updateVolatileState(); _current_relative_affine.setIdentity(); _center_is_set = false; // reread _center from items, or set to bbox midpoint + _makeHandles(); _updateHandles(); _selection = sp_desktop_selection(desktop); @@ -190,19 +184,9 @@ Inkscape::SelTrans::~SelTrans() _sel_changed_connection.disconnect(); _sel_modified_connection.disconnect(); - for (unsigned int i = 0; i < 8; i++) { - if (_shandle[i]) { - g_object_unref(G_OBJECT(_shandle[i])); - _shandle[i] = NULL; - } - if (_rhandle[i]) { - g_object_unref(G_OBJECT(_rhandle[i])); - _rhandle[i] = NULL; - } - } - if (_chandle) { - g_object_unref(G_OBJECT(_chandle)); - _chandle = NULL; + for (int i = 0; i < NUMHANDS; i++) { + g_object_unref(G_OBJECT(knots[i])); + knots[i] = NULL; } if (_norm) { @@ -584,13 +568,11 @@ void Inkscape::SelTrans::stamp() void Inkscape::SelTrans::_updateHandles() { + for (int i = 0; i < NUMHANDS; i++) + sp_knot_hide(knots[i]); + if ( !_show_handles || _empty ) - { - sp_remove_handles(_shandle, 8); - sp_remove_handles(_rhandle, 8); - sp_remove_handles(&_chandle, 1); return; - } if (!_center_is_set) { _center = _desktop->selection->center(); @@ -598,57 +580,12 @@ void Inkscape::SelTrans::_updateHandles() } if ( _state == STATE_SCALE ) { - sp_remove_handles(_rhandle, 8); - sp_remove_handles(&_chandle, 1); - _showHandles(_shandle, handles_scale, 8, - _("Squeeze or stretch selection; with Ctrl to scale uniformly; with Shift to scale around rotation center"), - _("Scale selection; with Ctrl to scale uniformly; with Shift to scale around rotation center")); + _showHandles(HANDLE_STRETCH); + _showHandles(HANDLE_SCALE); } else { - sp_remove_handles(_shandle, 8); - _showHandles(_rhandle, handles_rotate, 8, - _("Skew selection; with Ctrl to snap angle; with Shift to skew around the opposite side"), - _("Rotate selection; with Ctrl to snap angle; with Shift to rotate around the opposite corner")); - // center handle - /* Assuming that the center handle is in its default position, ie. in the center: - * Multiple handles will be shown, for rotating, skewing and the center handle. For straight lines, the bounding box of the center handle will be - * fully overlapped by bounding boxes of two of the skew handles. Due to the internals of sp_canvas_group_point, the center handle must be the - * last handle in the SPCanvasGroup if it is to be selectable in such a case. So we have made sure here that the center handle is added to the - * group after the rotation handles (determined by the chronological order of sp_knot_new() calls) - * Now when the center handle is in still in the center, the skew handles can be selected because because the bounding box of the - * center handle does not fully overlap the bounding box of either of the skew handles. However, if the center handle has been moved such that it - * covers one of the other eight handles, then either the opposite handle has to be used (in case of rotating), or the center handle has to be moved. - * Although this is annoying, this is still better than not being able to select the center handle at all - */ - if ( _chandle == NULL ) { - _chandle = sp_knot_new(_desktop, _("Center of rotation and skewing: drag to reposition; scaling with Shift also uses this center")); - - _chandle->setShape (SP_CTRL_SHAPE_BITMAP); - _chandle->setSize (13); - _chandle->setAnchor (handle_center.anchor); - _chandle->setMode (SP_CTRL_MODE_XOR); - _chandle->setFill(0x00000000, 0x00000000, 0x00000000); - _chandle->setStroke(0x000000ff, 0xff0000b0, 0xff0000b0); - _chandle->setPixbuf(handles[handle_center.control]); - sp_knot_update_ctrl(_chandle); - - g_signal_connect(G_OBJECT(_chandle), "request", - G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "moved", - G_CALLBACK(sp_sel_trans_handle_new_event), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "grabbed", - G_CALLBACK(sp_sel_trans_handle_grab), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "ungrabbed", - G_CALLBACK(sp_sel_trans_handle_ungrab), (gpointer) &handle_center); - g_signal_connect(G_OBJECT(_chandle), "clicked", - G_CALLBACK(sp_sel_trans_handle_click), (gpointer) &handle_center); - } - - if ( _center ) { - sp_knot_show(_chandle); - sp_knot_moveto(_chandle, *_center); - } else { - sp_remove_handles(&_chandle, 1); - } + _showHandles(HANDLE_SKEW); + _showHandles(HANDLE_ROTATE); + _showHandles(HANDLE_CENTER); } } @@ -673,53 +610,60 @@ void Inkscape::SelTrans::_updateVolatileState() _strokewidth = stroke_average_width (selection->itemList()); } -static void sp_remove_handles(SPKnot *knot[], gint num) +void Inkscape::SelTrans::_showHandles(SPSelTransType type) { - for (int i = 0; i < num; i++) { - if (knot[i] != NULL) { - sp_knot_hide(knot[i]); - } + // shouldn't have nullary bbox, but knots + g_assert(_bbox); + + for (int i = 0; i < NUMHANDS; i++) { + if (hands[i].type != type) + continue; + + // Position knots to scale the selection bbox + Geom::Point const bpos(hands[i].x, hands[i].y); + Geom::Point p(_bbox->min() + (_bbox->dimensions() * Geom::Scale(bpos))); + sp_knot_moveto(knots[i], p); + sp_knot_show(knots[i]); + + // This controls the center handle's position, because the default can + // be moved and needs to be remembered. + if( type == HANDLE_CENTER && _center ) + sp_knot_moveto(knots[i], *_center); } } -void Inkscape::SelTrans::_showHandles(SPKnot *knot[], SPSelTransHandle const handle[], gint num, - gchar const *even_tip, gchar const *odd_tip) +void Inkscape::SelTrans::_makeHandles() { - g_return_if_fail( !_empty ); - - for (int i = 0; i < num; i++) { - if (knot[i] == NULL) { - knot[i] = sp_knot_new(_desktop, i % 2 ? even_tip : odd_tip); - - knot[i]->setShape (SP_CTRL_SHAPE_BITMAP); - knot[i]->setSize (13); - knot[i]->setAnchor (handle[i].anchor); - knot[i]->setMode (SP_CTRL_MODE_XOR); - knot[i]->setFill(0x000000ff, 0x00ff6600, 0x00ff6600); // inversion, green, green - knot[i]->setStroke(0x000000ff, 0x000000ff, 0x000000ff); // inversion - knot[i]->setPixbuf(handles[handle[i].control]); - sp_knot_update_ctrl(knot[i]); - - g_signal_connect(G_OBJECT(knot[i]), "request", - G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "moved", - G_CALLBACK(sp_sel_trans_handle_new_event), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "grabbed", - G_CALLBACK(sp_sel_trans_handle_grab), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "ungrabbed", - G_CALLBACK(sp_sel_trans_handle_ungrab), (gpointer) &handle[i]); - g_signal_connect(G_OBJECT(knot[i]), "event", G_CALLBACK(sp_seltrans_handle_event), (gpointer) &handle[i]); + for (int i = 0; i < NUMHANDS; i++) { + knots[i] = sp_knot_new(_desktop, handtypes[hands[i].type].tip); + + knots[i]->setShape(SP_CTRL_SHAPE_BITMAP); + knots[i]->setSize(13); + knots[i]->setAnchor(hands[i].anchor); + knots[i]->setMode(SP_CTRL_MODE_XOR); + knots[i]->setFill(0x000000ff, 0x00ff6600, 0x00ff6600); // invert+2*green + knots[i]->setStroke(0x000000ff, 0x000000ff, 0x000000ff); // 3*invert + knots[i]->setPixbuf(handles[hands[i].control]); + sp_knot_update_ctrl(knots[i]); + + if( hands[i].type == HANDLE_CENTER ) { + _center_handle = i; + knots[i]->setFill(0x00000000, 0x00000000, 0x00000000); + knots[i]->setStroke(0x000000ff, 0xff0000b0, 0xff0000b0); } - sp_knot_show(knot[i]); - - Geom::Point const handle_pt(handle[i].x, handle[i].y); - // shouldn't have nullary bbox, but knots - g_assert(_bbox); - Geom::Point p( _bbox->min() - + ( _bbox->dimensions() - * Geom::Scale(handle_pt) ) ); - sp_knot_moveto(knot[i], p); + g_signal_connect(G_OBJECT(knots[i]), "request", + G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "moved", + G_CALLBACK(sp_sel_trans_handle_new_event), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "grabbed", + G_CALLBACK(sp_sel_trans_handle_grab), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "ungrabbed", + G_CALLBACK(sp_sel_trans_handle_ungrab), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "clicked", + G_CALLBACK(sp_sel_trans_handle_click), (gpointer) &hands[i]); + g_signal_connect(G_OBJECT(knots[i]), "event", + G_CALLBACK(sp_sel_trans_handle_event), (gpointer) &hands[i]); } } @@ -758,8 +702,8 @@ static void sp_sel_trans_handle_click(SPKnot *knot, guint state, gpointer data) void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHandle const &handle) { - switch (handle.anchor) { - case SP_ANCHOR_CENTER: + switch (handle.type) { + case HANDLE_CENTER: if (state & GDK_SHIFT_MASK) { // Unset the center position for all selected items for (GSList const *l = _desktop->selection->itemList(); l; l = l->next) { @@ -780,8 +724,8 @@ void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHa void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint /*state*/, SPSelTransHandle const &handle) { - switch (handle.anchor) { - case SP_ANCHOR_CENTER: + switch (handle.type) { + case HANDLE_CENTER: g_object_set(G_OBJECT(_grip), "shape", SP_CTRL_SHAPE_BITMAP, "size", 13.0, @@ -795,7 +739,6 @@ void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint /*state*/, SPSelTransHan NULL); sp_canvas_item_show(_norm); sp_canvas_item_show(_grip); - break; } @@ -816,21 +759,35 @@ void Inkscape::SelTrans::handleNewEvent(SPKnot *knot, Geom::Point *position, gui return; } } - - handle.action(this, handle, *position, state); + switch (handle.type) { + case HANDLE_SCALE: + scale(*position, state); + break; + case HANDLE_STRETCH: + stretch(handle, *position, state); + break; + case HANDLE_SKEW: + skew(handle, *position, state); + break; + case HANDLE_ROTATE: + rotate(*position, state); + break; + case HANDLE_CENTER: + setCenter(*position); + break; + } } gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, Geom::Point *position, guint state, SPSelTransHandle const &handle) { - if (!SP_KNOT_IS_GRABBED(knot)) { + if (!SP_KNOT_IS_GRABBED(knot)) return TRUE; - } // When holding shift while rotating or skewing, the transformation will be // relative to the point opposite of the handle; otherwise it will be relative // to the center as set for the selection - if ((!(state & GDK_SHIFT_MASK) == !(_state == STATE_ROTATE)) && (&handle != &handle_center)) { + if ((!(state & GDK_SHIFT_MASK) == !(_state == STATE_ROTATE)) && (handle.type != HANDLE_CENTER)) { _origin = _opposite; _origin_for_bboxpoints = _opposite_for_bboxpoints; _origin_for_specpoints = _opposite_for_specpoints; @@ -842,10 +799,10 @@ gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, Geom::Point *position, // FIXME return TRUE; } - if (handle.request(this, handle, *position, state)) { + if (request(handle, *position, state)) { sp_knot_set_position(knot, *position, state); SP_CTRL(_grip)->moveto(*position); - if (&handle == &handle_center) { + if (handle.type == HANDLE_CENTER) { SP_CTRL(_norm)->moveto(*position); } else { SP_CTRL(_norm)->moveto(_origin); @@ -908,36 +865,6 @@ static double sign(double const x) : 1 ); } -gboolean sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - return seltrans->scaleRequest(pt, state); -} - -gboolean sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - return seltrans->stretchRequest(handle, pt, state); -} - -gboolean sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - return seltrans->skewRequest(handle, pt, state); -} - -gboolean sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - return seltrans->rotateRequest(pt, state); -} - -gboolean sp_sel_trans_center_request(Inkscape::SelTrans *seltrans, - SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - return seltrans->centerRequest(pt, state); -} - gboolean Inkscape::SelTrans::scaleRequest(Geom::Point &pt, guint state) { @@ -1117,6 +1044,24 @@ gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, Geom return TRUE; } +gboolean Inkscape::SelTrans::request(SPSelTransHandle const &handle, Geom::Point &pt, guint state) +{ + // These _should_ be in the handstype somewhere instead + switch (handle.type) { + case HANDLE_SCALE: + return scaleRequest(pt, state); + case HANDLE_STRETCH: + return stretchRequest(handle, pt, state); + case HANDLE_SKEW: + return skewRequest(handle, pt, state); + case HANDLE_ROTATE: + return rotateRequest(pt, state); + case HANDLE_CENTER: + return centerRequest(pt, state); + } + return FALSE; +} + gboolean Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, Geom::Point &pt, guint state) { /* When skewing (or rotating): @@ -1347,25 +1292,7 @@ gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state) * */ -void sp_sel_trans_stretch(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - seltrans->stretch(handle, pt, state); -} - -void sp_sel_trans_scale(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - seltrans->scale(pt, state); -} -void sp_sel_trans_skew(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, Geom::Point &pt, guint state) -{ - seltrans->skew(handle, pt, state); -} - -void sp_sel_trans_rotate(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, Geom::Point &pt, guint state) -{ - seltrans->rotate(pt, state); -} void Inkscape::SelTrans::stretch(SPSelTransHandle const &/*handle*/, Geom::Point &/*pt*/, guint /*state*/) { @@ -1387,12 +1314,6 @@ void Inkscape::SelTrans::rotate(Geom::Point &/*pt*/, guint /*state*/) transform(_relative_affine, _origin); } -void sp_sel_trans_center(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, Geom::Point &pt, guint /*state*/) -{ - seltrans->setCenter(pt); -} - - void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state) { SnapManager &m = _desktop->namedview->snap_manager; -- cgit v1.2.3 From 419d9398abf7b8bae74548d5b2bbd8554b36a9b3 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 3 Jul 2013 12:59:04 -0400 Subject: Make handle colour a configurable property. (bzr r12401) --- src/seltrans.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 016eba816..33bfe3e4a 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -635,23 +635,18 @@ void Inkscape::SelTrans::_showHandles(SPSelTransType type) void Inkscape::SelTrans::_makeHandles() { for (int i = 0; i < NUMHANDS; i++) { - knots[i] = sp_knot_new(_desktop, handtypes[hands[i].type].tip); + SPSelTransTypeInfo info = handtypes[hands[i].type]; + knots[i] = sp_knot_new(_desktop, info.tip); knots[i]->setShape(SP_CTRL_SHAPE_BITMAP); knots[i]->setSize(13); knots[i]->setAnchor(hands[i].anchor); knots[i]->setMode(SP_CTRL_MODE_XOR); - knots[i]->setFill(0x000000ff, 0x00ff6600, 0x00ff6600); // invert+2*green - knots[i]->setStroke(0x000000ff, 0x000000ff, 0x000000ff); // 3*invert + knots[i]->setFill(info.color[0], info.color[1], info.color[2]); + knots[i]->setStroke(info.color[3], info.color[4], info.color[5]); knots[i]->setPixbuf(handles[hands[i].control]); sp_knot_update_ctrl(knots[i]); - if( hands[i].type == HANDLE_CENTER ) { - _center_handle = i; - knots[i]->setFill(0x00000000, 0x00000000, 0x00000000); - knots[i]->setStroke(0x000000ff, 0xff0000b0, 0xff0000b0); - } - g_signal_connect(G_OBJECT(knots[i]), "request", G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &hands[i]); g_signal_connect(G_OBJECT(knots[i]), "moved", -- cgit v1.2.3 From fdf69629c66f6c1a69d88a00bb6c1311c97b631b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 20 Jul 2013 15:08:31 -0400 Subject: Ported away from and removed "sp-metrics.*". (bzr r12380.1.47) --- src/seltrans.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 33bfe3e4a..f614853bc 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -37,7 +37,6 @@ #include "seltrans-handles.h" #include "seltrans.h" #include "selection-chemistry.h" -#include "sp-metrics.h" #include "verbs.h" #include #include "display/sp-ctrlline.h" @@ -1273,8 +1272,10 @@ gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state) m.unSetup(); // status text - GString *xs = SP_PX_TO_METRIC_STRING(pt[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *ys = SP_PX_TO_METRIC_STRING(pt[Geom::Y], _desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(pt[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(pt[Geom::Y], "px"); + GString *xs = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); _message_context.setF(Inkscape::NORMAL_MESSAGE, _("Move center to %s, %s"), xs->str, ys->str); g_string_free(xs, FALSE); g_string_free(ys, FALSE); @@ -1425,8 +1426,10 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state) transform(move, norm); // status text - GString *xs = SP_PX_TO_METRIC_STRING(dxy[Geom::X], _desktop->namedview->getDefaultMetric()); - GString *ys = SP_PX_TO_METRIC_STRING(dxy[Geom::Y], _desktop->namedview->getDefaultMetric()); + Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dxy[Geom::X], "px"); + Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dxy[Geom::Y], "px"); + GString *xs = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); _message_context.setF(Inkscape::NORMAL_MESSAGE, _("Move by %s, %s; with Ctrl to restrict to horizontal/vertical; with Shift to disable snapping"), xs->str, ys->str); g_string_free(xs, TRUE); g_string_free(ys, TRUE); -- cgit v1.2.3 From a970dc423d59ea844bdb1af48d5d9419a5e2a287 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 13 Oct 2013 00:24:05 +0200 Subject: Units: stop newing Unit objects. pass around pointers to "undeletable" Unit objects in the UnitTable. I think we should move to using indexed units, and pass around the index of the unit in the unittable, or smth like that... ? (bzr r12679) --- src/seltrans.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index f614853bc..7a8f5ec17 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -1274,8 +1274,8 @@ gboolean Inkscape::SelTrans::centerRequest(Geom::Point &pt, guint state) // status text Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(pt[Geom::X], "px"); Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(pt[Geom::Y], "px"); - GString *xs = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); - GString *ys = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); + GString *xs = g_string_new(x_q.string(_desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(y_q.string(_desktop->namedview->doc_units).c_str()); _message_context.setF(Inkscape::NORMAL_MESSAGE, _("Move center to %s, %s"), xs->str, ys->str); g_string_free(xs, FALSE); g_string_free(ys, FALSE); @@ -1428,8 +1428,8 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state) // status text Inkscape::Util::Quantity x_q = Inkscape::Util::Quantity(dxy[Geom::X], "px"); Inkscape::Util::Quantity y_q = Inkscape::Util::Quantity(dxy[Geom::Y], "px"); - GString *xs = g_string_new(x_q.string(*_desktop->namedview->doc_units).c_str()); - GString *ys = g_string_new(y_q.string(*_desktop->namedview->doc_units).c_str()); + GString *xs = g_string_new(x_q.string(_desktop->namedview->doc_units).c_str()); + GString *ys = g_string_new(y_q.string(_desktop->namedview->doc_units).c_str()); _message_context.setF(Inkscape::NORMAL_MESSAGE, _("Move by %s, %s; with Ctrl to restrict to horizontal/vertical; with Shift to disable snapping"), xs->str, ys->str); g_string_free(xs, TRUE); g_string_free(ys, TRUE); -- cgit v1.2.3 From af8374a9745905bde55e5b19425bf95b2fd3f935 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Wed, 16 Oct 2013 21:47:12 +0200 Subject: static code analysis: performance (bzr r12695) --- src/seltrans.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 7a8f5ec17..ed0fd3a08 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -1394,7 +1394,7 @@ void Inkscape::SelTrans::moveTo(Geom::Point const &xy, guint state) /* Pick one */ Inkscape::SnappedPoint best_snapped_point; - for (std::list::const_iterator i = s.begin(); i != s.end(); i++) { + for (std::list::const_iterator i = s.begin(); i != s.end(); ++i) { if (i->getSnapped()) { if (best_snapped_point.isOtherSnapBetter(*i, true)) { best_snapped_point = *i; -- cgit v1.2.3 From 55b451bf382e0c3d5ed8728e42fbb535acfa8a33 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Thu, 7 Nov 2013 21:44:00 +0100 Subject: First step of moving tools into appropriate namespaces. (bzr r12782) --- src/seltrans.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index ed0fd3a08..568ad6a09 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -66,7 +66,7 @@ static gboolean sp_sel_trans_handle_event(SPKnot *knot, GdkEvent *event, gpointe case GDK_MOTION_NOTIFY: break; case GDK_KEY_PRESS: - if (get_group0_keyval (&event->key) == GDK_KEY_space) { + if (Inkscape::UI::Tools::get_group0_keyval (&event->key) == GDK_KEY_space) { /* stamping mode: both mode(show content and outline) operation with knot */ if (!SP_KNOT_IS_GRABBED(knot)) { return FALSE; -- cgit v1.2.3 From c04e30df241a3ee039077425bab9b9c37abe2854 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 9 Nov 2013 23:36:13 +0100 Subject: Moved and renamed some tool-related files. (bzr r12785) --- src/seltrans.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 568ad6a09..f961e309d 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -31,7 +31,7 @@ #include "knot.h" #include "snap.h" #include "selection.h" -#include "select-context.h" +#include "ui/tools/select-tool.h" #include "sp-item.h" #include "sp-item-transform.h" #include "seltrans-handles.h" -- cgit v1.2.3 From 3b7a3bd5d820cb7c41fe99254129d6603a5e9ff2 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Tue, 17 Dec 2013 18:01:44 -0500 Subject: modify transform behaviour for scaled stroke width, Preserved Transforms (bzr r12852) --- src/seltrans.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index f961e309d..d1d39532c 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -1460,7 +1460,8 @@ Geom::Point Inkscape::SelTrans::_getGeomHandlePos(Geom::Point const &visual_hand // Calculate the absolute affine while taking into account the scaling of the stroke width Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool transform_stroke = prefs->getBool("/options/transform/stroke", true); - Geom::Affine abs_affine = get_scale_transform_for_uniform_stroke (*_bbox, _strokewidth, transform_stroke, + bool preserve = prefs->getBool("/options/preservetransform/value", false); + Geom::Affine abs_affine = get_scale_transform_for_uniform_stroke (*_bbox, _strokewidth, transform_stroke, preserve, new_bbox.min()[Geom::X], new_bbox.min()[Geom::Y], new_bbox.max()[Geom::X], new_bbox.max()[Geom::Y]); // Calculate the scaled geometrical bbox @@ -1499,15 +1500,17 @@ Geom::Point Inkscape::SelTrans::_calcAbsAffineDefault(Geom::Scale const default_ Geom::Point new_bbox_max = _visual_bbox->max() * abs_affine; bool transform_stroke = false; + bool preserve = false; gdouble strokewidth = 0; if ( _snap_bbox_type != SPItem::GEOMETRIC_BBOX) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); transform_stroke = prefs->getBool("/options/transform/stroke", true); + preserve = prefs->getBool("/options/preservetransform/value", false); strokewidth = _strokewidth; } - _absolute_affine = get_scale_transform_for_uniform_stroke (*_visual_bbox, strokewidth, transform_stroke, + _absolute_affine = get_scale_transform_for_uniform_stroke (*_visual_bbox, strokewidth, transform_stroke, preserve, new_bbox_min[Geom::X], new_bbox_min[Geom::Y], new_bbox_max[Geom::X], new_bbox_max[Geom::Y]); // return the new handle position -- cgit v1.2.3 From 08945ee8afa6e300b0a7ad8f20710db4756c2528 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Mon, 30 Dec 2013 15:23:58 -0500 Subject: modify transform behaviour for unscaled stroke width, Preserved Transforms (Bug 1262146) Fixed bugs: - https://launchpad.net/bugs/1262146 (bzr r12863) --- src/seltrans.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index d1d39532c..78d9958c4 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -1461,7 +1461,7 @@ Geom::Point Inkscape::SelTrans::_getGeomHandlePos(Geom::Point const &visual_hand Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool transform_stroke = prefs->getBool("/options/transform/stroke", true); bool preserve = prefs->getBool("/options/preservetransform/value", false); - Geom::Affine abs_affine = get_scale_transform_for_uniform_stroke (*_bbox, _strokewidth, transform_stroke, preserve, + Geom::Affine abs_affine = get_scale_transform_for_uniform_stroke (*_bbox, _strokewidth, _strokewidth, transform_stroke, preserve, new_bbox.min()[Geom::X], new_bbox.min()[Geom::Y], new_bbox.max()[Geom::X], new_bbox.max()[Geom::Y]); // Calculate the scaled geometrical bbox @@ -1501,16 +1501,18 @@ Geom::Point Inkscape::SelTrans::_calcAbsAffineDefault(Geom::Scale const default_ bool transform_stroke = false; bool preserve = false; - gdouble strokewidth = 0; + gdouble stroke_x = 0; + gdouble stroke_y = 0; if ( _snap_bbox_type != SPItem::GEOMETRIC_BBOX) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); transform_stroke = prefs->getBool("/options/transform/stroke", true); preserve = prefs->getBool("/options/preservetransform/value", false); - strokewidth = _strokewidth; + stroke_x = _visual_bbox->width() - _geometric_bbox->width(); + stroke_y = _visual_bbox->height() - _geometric_bbox->height(); } - _absolute_affine = get_scale_transform_for_uniform_stroke (*_visual_bbox, strokewidth, transform_stroke, preserve, + _absolute_affine = get_scale_transform_for_uniform_stroke (*_visual_bbox, stroke_x, stroke_y, transform_stroke, preserve, new_bbox_min[Geom::X], new_bbox_min[Geom::Y], new_bbox_max[Geom::X], new_bbox_max[Geom::Y]); // return the new handle position -- cgit v1.2.3 From e32a54537e44cda5d90aa8b26d7fde87bff0ca58 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 28 Feb 2014 15:08:12 +0100 Subject: Embedded SVG's cannot be transformed. (bzr r13076) --- src/seltrans.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/seltrans.cpp') diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 78d9958c4..a55bc3c0d 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -29,11 +29,13 @@ #include "desktop-handles.h" #include "desktop-style.h" #include "knot.h" +#include "message-stack.h" #include "snap.h" #include "selection.h" #include "ui/tools/select-tool.h" #include "sp-item.h" #include "sp-item-transform.h" +#include "sp-root.h" #include "seltrans-handles.h" #include "seltrans.h" #include "selection-chemistry.h" @@ -381,6 +383,10 @@ void Inkscape::SelTrans::transform(Geom::Affine const &rel_affine, Geom::Point c // update the content for (unsigned i = 0; i < _items.size(); i++) { SPItem &item = *_items[i]; + if( SP_IS_ROOT(&item) ) { + _desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot transform an embedded SVG.")); + break; + } Geom::Affine const &prev_transform = _items_affines[i]; item.set_i2d_affine(prev_transform * affine); } -- cgit v1.2.3