[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] note-by-number - horizontal flag positioning
From: |
Risto Vääräniemi |
Subject: |
Re: [PATCH] note-by-number - horizontal flag positioning |
Date: |
Thu, 24 Apr 2008 15:07:13 +0300 |
2008/4/23 Han-Wen Nienhuys :
> The reference point is the center of the stem, and the flag attaches
> to the right side of the stem.
2008/4/24 Han-Wen Nienhuys :
> If it is a rounding error, the difference should be 1 pixel at most;
> on a 600 dpi printer, that's practically invisible. There may be
> another systematic error.
I tried to look the code a little bit closer.
It seems that the reference point is not the middle of the stem but
the edge of the note head (attach-off). The stem is also positioned
based on that.
Because the flags are not aligned on their flat side corner but on the
other corner (please, see the image, hard to explain) the zero point
(not the flat side) should be aligned with the stem edge.
With stem up situation the horizontal zero point should be aligned to
the note head edge and stem down situation it should be aligned to
note head edge + stem thickness.
The flag positioning code should be something like this:
(flaggl (and (> log 2)
(ly:stencil-translate
(ly:font-get-glyph font
(string-append "flags."
(if (> dir 0) "d" "u")
(number->string log)))
(cons (if (> dir 0) (car attach-off) (+ (car attach-off)
stem-thickness)) stemy)))))
-Risto
markup_note_flags_zero.png
Description: PNG image