+2004-03-21 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/system.cc (uniquify_list): bugfix. This fixes spuriously
+ translated stencils in the output.
+
+ * lily/paper-outputter.cc (output_line): don't add Stencil::origin.
+
2004-03-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
* lily/tie-performer.cc (acknowledge_audio_element): bugfix: use
{
Stencil *stil = unsmob_stencil (ly_car (s));
if (stil)
- output_expr (stil->get_expr (), stil->origin ());
+ output_expr (stil->get_expr (), Offset (0,0));
/* Only if !PAGE_LAYOUT */
else if (ly_caar (s) == ly_symbol2scm ("between-system-string"))
between = ly_cdar (s);
Stencil *s = unsmob_stencil (stil);
SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- SCM_ASSERT_TYPE (is_number_pair (np), np, SCM_ARG3, __FUNCTION__, "number pair");
+ SCM_ASSERT_TYPE (is_number_pair (np), np, SCM_ARG3, __FUNCTION__,
+ "number pair");
Interval iv = ly_scm2interval (np);
s->dim_[Axis (gh_scm2int (axis))] = iv;
int len = scm_ilength (l);
SCM * arr = new SCM[len];
int k = 0;
- for (SCM s =l ; SCM_NNULLP (s); s = SCM_CDR (s))
+ for (SCM s = l; SCM_NNULLP (s); s = SCM_CDR (s))
arr[k++] = SCM_CAR (s);
assert (k == len);
qsort (arr, len, sizeof (SCM), &scm_default_compare);
k = 0;
- SCM s =l;
+ SCM *tail = &l;
+
for (int i = 0; i < len ; i++)
{
if (i && arr[i] == arr[i-1])
continue;
- SCM_SETCAR (s, arr[i]);
-
- if (i < len - 1)
- s = SCM_CDR (s);
+ SCM_SETCAR (*tail, arr[i]);
+ tail = SCM_CDRLOC(*tail);
}
- SCM_SETCDR (s, SCM_EOL);
+ *tail = SCM_EOL;
delete[] arr;
return l;
Start with layer 3, since scm_cons prepends to list.
*/
+ SCM all = get_property ("all-elements");
+
for (int i = LAYER_COUNT; i--;)
- for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
Stencil *stil = g->get_stencil ();
Offset extra = robust_scm2offset (g->get_property ("extra-offset"),
Offset (0, 0))
* Staff_symbol_referencer::staff_space (g);
-
- /* FIXME: 0.5 */
- stil->translate ((o + extra) * 0.5);
- stencils = scm_cons (stil->smobbed_copy (), stencils);
+
+ /*
+ must copy the stencil, for we cannot change the stencil
+ cached in G.
+ */
+ SCM my_stencil = stil->smobbed_copy ();
+ unsmob_stencil (my_stencil)->translate (o + extra);
+ stencils = scm_cons (my_stencil, stencils);
}
if (output_format_global != PAGE_LAYOUT)