class Dot_column_engraver : public Engraver
{
Grob *dotcol_;
- vector<Item*> heads_;
public:
TRANSLATOR_DECLARATIONS (Dot_column_engraver);
Dot_column_engraver::stop_translation_timestep ()
{
dotcol_ = 0;
- heads_.clear ();
}
void
}
int p = Staff_symbol_referencer::get_rounded_position (dp.dot_);
+
+ /* icky, since this should go via a Staff_symbol_referencer
+ offset callback but adding a dot overwrites Y-offset. */
+ p += (int) robust_scm2double (dp.dot_->get_property ("staff-position"), 0.0);
dp.pos_ = p;
if (dp.extremal_head_)
#include "font-interface.hh"
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
-#include "directional-element-interface.hh"
#include "international.hh"
MAKE_SCHEME_CALLBACK (Dots, print, 1);
else
amount += ss / 2;
- Grob *dot = unsmob_grob (me->get_object ("dot"));
- if (dot && duration_log > 4) // UGH.
- {
- dot->set_property ("staff-position",
- scm_from_int ((duration_log == 7) ? 4 : 3));
- }
- if (dot && duration_log >= -1 && duration_log <= 1) // UGH again.
- {
- dot->set_property ("staff-position",
- scm_from_int ((duration_log == 0) ? -1 : 1));
- }
-
if (!position_override)
amount += 2 * ss * get_grob_direction (me);;
. (
(stencil . ,ly:dots::print)
(dot-count . ,dots::calc-dot-count)
+ (staff-position . ,dots::calc-staff-position)
(meta . ((class . Item)
(interfaces . (font-interface
staff-symbol-referencer-interface
(ly:duration-dot-count
(ly:event-property (event-cause grob) 'duration)))
+(define-public (dots::calc-staff-position grob)
+ (let*
+ ((head (ly:grob-parent grob Y))
+ (log (ly:grob-property head 'duration-log)))
+
+ (cond
+ ((or (not (grob::has-interface head 'rest-interface))
+ (not (integer? log))) 0)
+ ((= log 7) 4)
+ ((> log 4) 3)
+ ((= log 0) -1)
+ ((= log 1) 1)
+ ((= log -1) 1)
+ (else 0))))
+
(define (note-head::calc-tablature-stem-attachment grob)
(cons 0.0 1.35))