Real stem_y = calc_stem_y_f (me, s, y, dy);
+ stem_y += Stem::get_direction (s)
+ * gh_scm2double (me->get_grob_property ("thickness")) / 2;
+
/* caution: stem measures in staff-positions */
Real id = me->relative_coordinate (common, Y_AXIS)
- stems[i]->relative_coordinate (common, Y_AXIS);
(prev && ! (prev->relative_coordinate (0, X_AXIS) < here->relative_coordinate (0, X_AXIS))))
programming_error ("Beams are not left-to-right");
- Real staffline_f = me->paper_l ()->get_var ("stafflinethickness");
int multiplicity = get_multiplicity (me);
SCM space_proc = me->get_grob_property ("space-function");
Real interbeam_f = gh_scm2double (space) ;
Real bdy = interbeam_f;
- Real stemdx = staffline_f;
-
+
#if 0
// ugh -> use commonx
Real dx = visible_stem_count (me) ?
Half beam should be one note-width,
but let's make sure two half-beams never touch
*/
+
+ // FIXME: TODO stem width
Real w = here->relative_coordinate (0, X_AXIS) - prev->relative_coordinate (0, X_AXIS);
w = w/2 <? nw_f;
Molecule a;
if (next)
{
- int rhalfs = Stem::beam_count (here,RIGHT) - Stem::beam_count (next,LEFT);
- int rwholebeams= Stem::beam_count (here,RIGHT) <? Stem::beam_count (next,LEFT) ;
+ int rhalfs = Stem::beam_count (here,RIGHT)
+ - Stem::beam_count (next,LEFT);
+ int rwholebeams= Stem::beam_count (here,RIGHT)
+ <? Stem::beam_count (next,LEFT) ;
- Real w = next->relative_coordinate (0, X_AXIS) - here->relative_coordinate (0, X_AXIS);
- Molecule a = Lookup::beam (dydx, w + stemdx, thick);
- a.translate_axis (- stemdx/2, X_AXIS);
+ Real w = next->relative_coordinate (0, X_AXIS)
+ - here->relative_coordinate (0, X_AXIS);
+
+ Real stem_w = gh_scm2double (next->get_grob_property ("thickness"))
+ // URG
+ * me->paper_l ()->get_var ("stafflinethickness");
+
+ Molecule a = Lookup::beam (dydx, w + stem_w, thick);
+ a.translate_axis (- stem_w/2, X_AXIS);
int j = 0;
Real gap_f = 0;
-
+
SCM gap = me->get_grob_property ("gap");
if (gh_number_p (gap))
{
else
gap_f = nw_f / 2;
w -= 2 * gap_f;
- a = Lookup::beam (dydx, w + stemdx, thick);
+ a = Lookup::beam (dydx, w + stem_w, thick);
}
for (; j < rwholebeams; j++)
Interval stem_y (y1,y2);
stem_y.unite (Interval (y2,y1));
+ // dy?
Real dy = Staff_symbol_referencer::staff_space (me)/2.0;
if (Grob *hed = support_head (me))
if (!invisible_b (me))
{
- Real stem_width = gh_scm2double (me->get_grob_property ("thickness")) * me->paper_l ()->get_var ("stafflinethickness");
+ Real stem_width = gh_scm2double (me->get_grob_property ("thickness"))
+ // URG
+ * me->paper_l ()->get_var ("stafflinethickness");
+
Molecule ss =Lookup::filledbox (Box (Interval (-stem_width/2, stem_width/2),
Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)));
mol.add_molecule (ss);
-%!PS-Adobe-1.0: lily.ps
+%!PS-Adobe-1.0: music-drawing-routines.ps
%
% Functions for direct and embedded PostScript
+
+%%
+/testing true def
+
+
+
+% FIXME: set with individual symbols
% round cappings
1 setlinecap
1 copy mul exch 1 copy mul add sqrt
} bind def
-/simpledraw_box % breapth width depth height
-{
- /h exch def
- /d exch def
- /w exch def
- /b exch def
-
- 0.01 setlinewidth
- 1 setlinejoin
- 0 0 moveto
- b neg d neg rmoveto
- b w add 0 rlineto
- 0 d h add rlineto
- b w add neg 0 rlineto
- %closepath gsave stroke grestore fill
- closepath fill
-} bind def
-
-
% FIXME. translate to middle of box.
% Nice rectangle with rounded corners
+% FIXME: linewidth hardcoded. check: too round?
/draw_box % breapth width depth height
{
- 1 setlinejoin
- /l 0.05 def
+ %% FIXME: hardcoded
+ currentdict /testing known {
+ %% real thin lines for testing
+ /l 0.005 def
+ }{
+ /l 0.05 def
+ } ifelse
+
+ 0 setlinecap
l setlinewidth
1 setlinejoin
l 2 div sub /h exch def
l 2 div sub /d exch def
+
+ %% UGH huh?
+ %% Where does this correction come from?
+ %% Why don't we need this in x direction?
+ h l 2 div sub /h exch def
+ d l 2 div sub /d exch def
+
l 2 div sub /w exch def
l 2 div sub /b exch def
0 d h add rlineto
b w add neg 0 rlineto
0 d h add neg rlineto
- closepath gsave stroke grestore fill
-} bind def
-
-% ugh, see rectfill
-/simpledraw_beam % slope width thick
-{
- /t exch def
- /w exch def
- w mul /h exch def
- 1 setlinejoin
- % ugh?
- 0.05 setlinewidth
- 0 t 2 div neg moveto
- w h rlineto
- 0 t rlineto
- w neg h neg rlineto
- 0 t neg rlineto
- closepath gsave stroke grestore fill
-} bind def
+ currentdict /testing known {
+ %% outline only, for testing:
+ stroke
+ }{
+ closepath gsave stroke grestore fill
+ } ifelse
+} bind def
% Nice beam with rounded corners
+% FIXME: linewidth hardcoded. check: too round?
/draw_beam % slope width thick
{
- % ugh?
- /l 0.1 def
+ %% FIXME: hardcoded
+ currentdict /testing known {
+ %% real thin lines for testing
+ /l 0.01 def
+ }{
+ /l 0.1 def
+ } ifelse
l 2 div setlinewidth
+
+ 0 setlinecap
1 setlinejoin
+
l sub /t exch def
l sub /w exch def
w mul /h exch def
0 t rlineto
w neg h neg rlineto
0 t neg rlineto
- closepath gsave stroke grestore fill
+
+ currentdict /testing known {
+ %% outline only, for testing:
+ stroke
+ }{
+ closepath gsave stroke grestore fill
+ } ifelse
} bind def
/draw_repeat_slash % width slope thick