#(define (inverted-flag stem-grob)
(let* ((dir (if (eqv? (ly:grob-property stem-grob 'direction) UP) "d" "u"))
(flag (retrieve-glyph-flag "" dir "" stem-grob))
+ (line-thickness (ly:staff-symbol-line-thickness stem-grob))
+ (stem-thickness (ly:grob-property stem-grob 'thickness))
+ (stem-width (* line-thickness stem-thickness))
(stroke-style (ly:grob-property stem-grob 'stroke-style))
(stencil (if (null? stroke-style) flag
- (add-stroke-glyph flag stem-grob dir stroke-style ""))))
- (ly:stencil-rotate-absolute stencil 180 0 0)))
+ (add-stroke-glyph flag stem-grob dir stroke-style "")))
+ (rotated-flag (ly:stencil-rotate-absolute stencil 180 0 0)))
+ (ly:stencil-translate rotated-flag (cons (- (/ stem-width 2)) 0))))
{
\override Score.RehearsalMark #'self-alignment-X = #LEFT
bool on_line = st ? Staff_symbol::on_line (g, pos) : false;
return scm_from_bool (on_line);
}
+
+LY_DEFINE (ly_staff_symbol_line_thickness, "ly:staff-symbol-line-thickness",
+ 1, 0, 0, (SCM grob),
+ "Returns the line-thickness of the staff associated with @var{grob}.")
+{
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ Grob *g = unsmob_grob (grob);
+ Real thickness = Staff_symbol_referencer::line_thickness (g);
+ return scm_from_double (thickness);
+}