From 890a0f771f0f2b2996525d0f8ccf72d93c7bdc6b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 3 Jun 2011 10:19:18 +0000 Subject: Avoid the awful Gnome::Canvas::Text entirely, saving a ton of memory. Instead, render the text to a Gnome::Canvas::Pixbuf, and simply render that, which consumes far less memory. Also, trim memory overhead per Node/Port/Connection considerably (mostly by using canvas object properties rather than redundant fields in classes, which are now removed). git-svn-id: http://svn.drobilla.net/lad/trunk/machina@3350 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/EdgeView.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/EdgeView.cpp b/src/gui/EdgeView.cpp index bb4e59c..a8a9f92 100644 --- a/src/gui/EdgeView.cpp +++ b/src/gui/EdgeView.cpp @@ -70,8 +70,7 @@ EdgeView::EdgeView(SharedPtr canvas, , _edge(edge) { set_color(edge_color(probability())); - set_handle_style(HANDLE_CIRCLE); - show_handle(true); + show_handle(true, HANDLE_CIRCLE); edge->signal_property.connect( sigc::mem_fun(this, &EdgeView::on_property)); @@ -100,7 +99,7 @@ EdgeView::show_label(bool show) bool EdgeView::on_event(GdkEvent* ev) { - SharedPtr canvas = PtrCast(_canvas.lock()); + MachinaCanvas* canvas = dynamic_cast(_canvas); if (ev->type == GDK_BUTTON_PRESS) { if (ev->button.state & GDK_CONTROL_MASK) { if (ev->button.button == 1) { -- cgit v1.2.1