From 624e0d3ecd8149acdb3a44ece08dccd3337b3300 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 26 Feb 2010 04:39:25 +0000 Subject: Add center parameter to FlowCanvas::Canvas::arrange with default value true (eqivalent default behaviour to API pre-r2496). Add FlowCanvas::Canvas::move_contents_to to allow apps to move canvas contents to a given location (e.g. the origin or the center), keeping their relative distances the same. This commit preserves centering by default with the option to arrange in the top left, but applications shouldn't assume anything about the origin of coordinates (i.e. applications should manually scroll to where items exist when loading a set of items with coordinates, not simply assume they are centered about a particular location). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2500 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/PatchCanvas.cpp | 4 ++-- src/gui/PatchCanvas.hpp | 2 +- src/gui/PatchWindow.cpp | 2 +- wscript | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 69cb0414..2a406191 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -278,9 +278,9 @@ PatchCanvas::build() void -PatchCanvas::arrange(bool ingen_doesnt_use_length_hints) +PatchCanvas::arrange(bool use_length_hints, bool center) { - FlowCanvas::Canvas::arrange(false); + FlowCanvas::Canvas::arrange(false, center); for (list >::iterator i = _items.begin(); i != _items.end(); ++i) (*i)->store_location(); diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index e4cfd1a8..9aa0eacf 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -61,7 +61,7 @@ public: virtual ~PatchCanvas() {} void build(); - void arrange(bool use_length_hints); + void arrange(bool use_length_hints, bool center); void show_human_names(bool show); void show_port_names(bool show); bool show_port_names() const { return _show_port_names; } diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 39544808..c4e7a39a 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -644,7 +644,7 @@ PatchWindow::event_quit() void PatchWindow::event_arrange() { - _view->canvas()->arrange(false); + _view->canvas()->arrange(false, false); } diff --git a/wscript b/wscript index e6b50df6..9a4094b9 100644 --- a/wscript +++ b/wscript @@ -42,7 +42,7 @@ def configure(conf): autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0', mandatory=True) autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.0', mandatory=True) autowaf.check_pkg(conf, 'raul', uselib_store='RAUL', atleast_version='0.6.2', mandatory=True) - autowaf.check_pkg(conf, 'flowcanvas', uselib_store='FLOWCANVAS', atleast_version='0.5.1', mandatory=False) + autowaf.check_pkg(conf, 'flowcanvas', uselib_store='FLOWCANVAS', atleast_version='0.6.1', mandatory=False) autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML2', atleast_version='2.6.0', mandatory=False) autowaf.check_pkg(conf, 'libglademm-2.4', uselib_store='GLADEMM', atleast_version='2.6.0', mandatory=False) if not Options.options.no_http: -- cgit v1.2.1