diff options
Diffstat (limited to 'src/widgets/rect-toolbar.cpp')
| -rw-r--r-- | src/widgets/rect-toolbar.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index b78f74d94..016aa4987 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -404,12 +404,20 @@ static void rect_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolB { static sigc::connection changed; - // TODO fixme: use of dynamic_cast<> seems wrong here. + // use of dynamic_cast<> seems wrong here -- we just need to check the current tool + if (dynamic_cast<Inkscape::UI::Tools::RectTool *>(ec)) { - changed = desktop->getSelection()->connectChanged(sigc::bind(sigc::ptr_fun(sp_rect_toolbox_selection_changed), holder)); + Inkscape::Selection *sel = desktop->getSelection(); + + changed = sel->connectChanged(sigc::bind(sigc::ptr_fun(sp_rect_toolbox_selection_changed), holder)); + + // Synthesize an emission to trigger the update + sp_rect_toolbox_selection_changed(sel, holder); } else { - if (changed) + if (changed) { changed.disconnect(); + purge_repr_listener(NULL, holder); + } } } |
