[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `\offsetPosition` fails
From: |
Werner LEMBERG |
Subject: |
Re: `\offsetPosition` fails |
Date: |
Sun, 12 Feb 2023 08:18:45 +0000 (UTC) |
> This is because it assumes that Slur.control-points is still set to
> its original callback at the time `after-line-breaking` is run,
> which isn't true if something like
> `ly:side-position-interface::move-to-extremal-staff`, in
> `BarNumber.after-line-breaking`, reads `control-points` earlier,
> making `(ly:grob-property-data grob 'control-points)` return the
> computed value. A good example of how `after-line-breaking` can be
> fragile.
>
> Try [...]
This works, thanks!
> I can see why the original snippet uses `after-line-breaking`: using
> `ly:slur::calc-control-points` directly here is suboptimal (needs
> updating if the default changes). The use of
> `ly:grob-set-property!` isn't wonderful either. Unfortunately, the
> slur code would need to be structured a bit differently to get rid
> of the latter one, although you could, if you care enough and with a
> bit more effort, address the former by creating a variant of
> `grob-transformer` passing the raw original callback to the
> transformer instead of the value it computes.
Well, the slur code is something that we have to tackle eventually,
but I guess it will take some time until this happens.
I have already updated https://lsr.di.unimi.it/LSR/Item?id=748 with
your code and will add this snippet to the NR soon.
Werner