diff --git a/libs/canvas/canvas/constraint_packer.h b/libs/canvas/canvas/constraint_packer.h index b1f36cac48..c7507c5942 100644 --- a/libs/canvas/canvas/constraint_packer.h +++ b/libs/canvas/canvas/constraint_packer.h @@ -30,12 +30,13 @@ namespace ArdourCanvas class Rectangle; class ConstrainedItem; +class BoxConstrainedItem; class LIBCANVAS_API ConstraintPacker : public Container { public: - ConstraintPacker (Canvas *); - ConstraintPacker (Item *); + ConstraintPacker (Canvas *, Orientation o = Horizontal); + ConstraintPacker (Item *, Orientation o = Horizontal); void add (Item *); void add_front (Item *); @@ -72,6 +73,12 @@ public: void non_const_preferred_size (Duple& mininum, Duple& natural); virtual void update_constraints (); + + private: + Orientation _orientation; + typedef std::list BoxPackedItems; + BoxPackedItems vpacked; + BoxPackedItems hpacked; }; } diff --git a/libs/canvas/constraint_packer.cc b/libs/canvas/constraint_packer.cc index bffa90d434..3a56b7dfc2 100644 --- a/libs/canvas/constraint_packer.cc +++ b/libs/canvas/constraint_packer.cc @@ -37,12 +37,13 @@ using std::vector; using kiwi::Constraint; using namespace kiwi; -ConstraintPacker::ConstraintPacker (Canvas* canvas) +ConstraintPacker::ConstraintPacker (Canvas* canvas, Orientation o) : Container (canvas) , width (X_("packer width")) , height (X_("packer height")) , in_alloc (false) , _need_constraint_update (false) + , _orientation (o) { set_fill (false); set_outline (false); @@ -52,12 +53,13 @@ ConstraintPacker::ConstraintPacker (Canvas* canvas) _solver.addEditVariable (height, kiwi::strength::strong); } -ConstraintPacker::ConstraintPacker (Item* parent) +ConstraintPacker::ConstraintPacker (Item* parent, Orientation o) : Container (parent) , width (X_("packer width")) , height (X_("packer height")) , in_alloc (false) , _need_constraint_update (false) + , _orientation (o) { set_fill (false); set_outline (false);