summaryrefslogtreecommitdiff
path: root/libs/surfaces/push2/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaces/push2/layout.cc')
-rw-r--r--libs/surfaces/push2/layout.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/libs/surfaces/push2/layout.cc b/libs/surfaces/push2/layout.cc
index f675e3ddbb..be5ff6fdaf 100644
--- a/libs/surfaces/push2/layout.cc
+++ b/libs/surfaces/push2/layout.cc
@@ -16,14 +16,17 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include "canvas.h"
#include "layout.h"
#include "push2.h"
using namespace ARDOUR;
using namespace ArdourSurface;
+using namespace ArdourCanvas;
Push2Layout::Push2Layout (Push2& p, Session& s)
- : p2 (p)
+ : Container (p.canvas())
+ , p2 (p)
, session (s)
{
}
@@ -32,8 +35,24 @@ Push2Layout::~Push2Layout ()
{
}
-bool
-Push2Layout::mapped () const
+void
+Push2Layout::compute_bounding_box () const
{
- return p2.current_layout() == this;
+ /* all layouts occupy at least the full screen, even if their combined
+ * child boxes do not.
+ */
+ _bounding_box = Rect (0, 0, display_width(), display_height());
+ _bounding_box_dirty = false;
+}
+
+int
+Push2Layout::display_height() const
+{
+ return p2.canvas()->rows();
+}
+
+int
+Push2Layout::display_width() const
+{
+ return p2.canvas()->cols();
}