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/widgets/toolbox.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 26947979d..61c7c8e88 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -5951,7 +5951,7 @@ static void lpetool_toggle_set_bbox(GtkToggleAction *act, gpointer data) SPDesktop *desktop = static_cast(data); Inkscape::Selection *selection = desktop->selection; - Geom::OptRect bbox = selection->bounds(); + Geom::OptRect bbox = selection->visualBounds(); if (bbox) { Geom::Point A(bbox->min()); @@ -6799,8 +6799,7 @@ static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl ) axis = Geom::Y; } - Geom::OptRect bbox - = item->getBounds(Geom::identity(), SPItem::GEOMETRIC_BBOX); + Geom::OptRect bbox = item->geometricBounds(); if (!bbox) continue; double width = bbox->dimensions()[axis]; -- cgit v1.2.3 From be7df18d6aef42dd657426b6a9d30834e5f54ca6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 28 Aug 2011 21:18:21 +0200 Subject: Remove nr-object.h and nr-macros.h (bzr r10582.1.10) --- src/widgets/toolbox.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 61c7c8e88..7edc24420 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -863,23 +863,6 @@ static void trigger_sp_action( GtkAction* /*act*/, gpointer user_data ) } } -static void sp_action_action_set_sensitive(SPAction * /*action*/, unsigned int sensitive, void *data) -{ - if ( data ) { - GtkAction* act = GTK_ACTION(data); - gtk_action_set_sensitive( act, sensitive ); - } -} - -static SPActionEventVector action_event_vector = { - {NULL}, - NULL, - NULL, - sp_action_action_set_sensitive, - NULL, - NULL -}; - static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::View::View* view, Inkscape::IconSize size ) { GtkAction* act = 0; @@ -891,8 +874,13 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi g_signal_connect( G_OBJECT(inky), "activate", G_CALLBACK(trigger_sp_action), targetAction ); - SPAction*rebound = dynamic_cast( nr_object_ref( dynamic_cast(targetAction) ) ); - nr_active_object_add_listener( (NRActiveObject *)rebound, (NRObjectEventVector *)&action_event_vector, sizeof(SPActionEventVector), inky ); + // FIXME: memory leak: this is not unrefed anywhere + g_object_ref(G_OBJECT(targetAction)); + g_object_set_data_full(G_OBJECT(inky), "SPAction", (void*) targetAction, (GDestroyNotify) &g_object_unref); + targetAction->signal_set_sensitive.connect( + sigc::bind<0>( + sigc::ptr_fun(>k_action_set_sensitive), + GTK_ACTION(inky))); return act; } -- cgit v1.2.3