X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fdot-configuration.cc;h=c4cf852d1a7a154d254b4d315745eeafbf5aae15;hb=246e7b9173ba32cec61c997b3b977535e6fb2807;hp=7676c14dd4cc3628d804b20016c147464d8aa862;hpb=5027fa60c3a76dc406fb1ba8fb4a0e24c2ccf38e;p=lilypond.git diff --git a/lily/dot-configuration.cc b/lily/dot-configuration.cc index 7676c14dd4..c4cf852d1a 100644 --- a/lily/dot-configuration.cc +++ b/lily/dot-configuration.cc @@ -9,6 +9,7 @@ */ #include "dot-configuration.hh" +#include "dot-formatting-problem.hh" #include "staff-symbol-referencer.hh" @@ -60,7 +61,7 @@ Dot_configuration::print () const Dot_configuration Dot_configuration::shifted (int k, Direction d) const { - Dot_configuration new_cfg; + Dot_configuration new_cfg (*problem_); int offset = 0; if (d > 0) @@ -141,3 +142,19 @@ Dot_configuration::remove_collision (int p) *this = (b_up < b_down) ? cfg_up : cfg_down; } } + +Dot_configuration::Dot_configuration (Dot_formatting_problem const &problem) +{ + problem_ = &problem; +} + +Real +Dot_configuration::x_offset () const +{ + Real off = 0.0; + for (Dot_configuration::const_iterator i (begin ()); + i != end (); i++) + off = max (off, problem_->head_skyline_.height ((*i).first)); + + return off; +}