[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inserting a grob into a Spanner NOT at last position
From: |
Joe Neeman |
Subject: |
Re: Inserting a grob into a Spanner NOT at last position |
Date: |
Tue, 16 Mar 2010 13:22:43 -0700 |
On Tue, 2010-03-16 at 15:46 +0100, Reinhold Kainhofer wrote:
> In the Figured_bass_engraver, I have a BassFigureAlignment spanner, where
> Align_interface::add_element is used to append new figures. However, with
> extenders turned on, it happens frequently that a new figure needs to be
> inserted into the spanner at some fixed position (e.g. the beginning).
>
> AFAICS, Align_interface::add_element always appends the newly inserted grob
> and places it at the bottom. I could not find any way how to insert a grob at
> a specified position (e.g. at the beginning rathen than at the end, or before
> another specified grob).
>
> AFAICS, Align_interface::add_element basically propagates the new grob to
> Pointer_group_interface::add_grob, where it is appended to the Grob_array
> (stored as the 'elements object of the spanner).
>
> So, how can I insert a grob at some other position?
>
> 1) Shall I simply append it using add_element and then try to extract the
> 'elements object and manually try to reorder afterwards?
This is more or less how alignAboveContext is handled (in
vertical-align-engraver.cc). If you moved that code to Align_interface
then you could reuse it.
Cheers,
Joe