aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-06-03 10:19:18 +0000
committerDavid Robillard <d@drobilla.net>2011-06-03 10:19:18 +0000
commit890a0f771f0f2b2996525d0f8ccf72d93c7bdc6b (patch)
treefabed452f713a902823e591ea755972152d6b197
parent6f51dbc1728b446ef727eff95ec38987ffb30539 (diff)
downloadmachina-890a0f771f0f2b2996525d0f8ccf72d93c7bdc6b.tar.gz
machina-890a0f771f0f2b2996525d0f8ccf72d93c7bdc6b.tar.bz2
machina-890a0f771f0f2b2996525d0f8ccf72d93c7bdc6b.zip
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
-rw-r--r--src/gui/EdgeView.cpp5
1 files changed, 2 insertions, 3 deletions
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> 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<MachinaCanvas> canvas = PtrCast<MachinaCanvas>(_canvas.lock());
+ MachinaCanvas* canvas = dynamic_cast<MachinaCanvas*>(_canvas);
if (ev->type == GDK_BUTTON_PRESS) {
if (ev->button.state & GDK_CONTROL_MASK) {
if (ev->button.button == 1) {