+
+ }
+
+ solved_slope_f_ = dir_ * slope_f_;
+
+ /*
+ This neat trick is by Werner Lemberg, damped = tanh (slope_f_) corresponds
+ with some tables in [Wanske]
+ */
+ if (damping_i_)
+ slope_f_ = 0.6 * tanh (slope_f_) / damping_i_;
+
+ /*
+ [TODO]
+ think
+
+ dropping lq for stemlengths solves [d d d] [d g d] "bug..."
+
+ but may be a bit too crude, and result in lots of
+ too high beams...
+
+ perhaps only if slope = 0 ?
+ */
+
+// left_y_ = sinfo[0].minyf_;
+
+ if (sinfo.size () >= 1)
+ {
+ Real staffline_f = paper ()->rule_thickness ();
+ Real epsilon_f = staffline_f / 8;
+ if (abs (slope_f_) < epsilon_f)
+ left_y_ = (sinfo[0].idealy_f_ + sinfo.top ().idealy_f_) / 2;
+ else
+ /*
+ symmetrical, but results often in having stemlength = minimal
+
+ left_y_ = sinfo[0].dir_ == dir_ ? sinfo[0].miny_f_ : sinfo[0].maxy_f_;
+
+ what about
+ */
+ {
+ Real dx = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
+ if (sinfo[0].dir_ == sinfo.top ().dir_)
+ left_y_ = sinfo[0].idealy_f_ >? sinfo.top ().idealy_f_ - slope_f_ * dx;
+ // knee
+ else
+ left_y_ = sinfo[0].idealy_f_;
+ }