change Grid API to avoid unnecessary Duple and open door for row/col span
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Jan 2017 17:41:11 +0000 (18:41 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 1 Feb 2017 20:58:20 +0000 (21:58 +0100)
libs/canvas/canvas/grid.h
libs/canvas/grid.cc

index cfed3f1643b5e0278da2e84e858f0234719ab45d..c0afa4bdfab163d9128defcbf12ceccc243cc90f 100644 (file)
@@ -47,7 +47,7 @@ public:
        void set_border_width (double w) { set_outline_width (w); }
        void set_border_color (Color c)  { set_outline_color (c); }
 
-       void place (Item*, Duple coord);
+       void place (Item*, double x, double y, double col_span = 1, double row_span = 1);
 
        void set_collapse_on_hide (bool);
        void set_homogenous (bool);
index 7ceb1585ed49ac20b3961f61bb1d4ac7019e1015..f8fd0bcce4626ca80535ba329edef16ebdb6e67a 100644 (file)
@@ -313,10 +313,10 @@ Grid::reposition_children ()
 }
 
 void
-Grid::place (Item* i, Duple at)
+Grid::place (Item* i, double x, double y, double col_span, double row_span)
 {
        add (i);
-       coords_by_item.insert (std::make_pair (i, at));
+       coords_by_item.insert (std::make_pair (i, Duple (x, y)));
        reposition_children ();
 }