[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: point-and-click in SVG
From: |
Graham Percival |
Subject: |
Re: point-and-click in SVG |
Date: |
Fri, 5 Apr 2013 16:28:56 -0700 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Apr 04, 2013 at 07:05:03AM +0200, Jan Nieuwenhuizen wrote:
> Graham Percival writes:
>
> > This is because output-svg.scm's
> > (grob-cause ...)
> > is called *before* drawing the path of the notehead, and SVG has
> > no z-index.
>
> What if you have grob-cause set a grob-cause for the subsequent
> notehead/grob to pick up and draw? Something like
>
> (define cause #f)
Thanks for the hints, everybody! Doesn't this global variable
break the whole scheme philosophy, though?
> would that work?
Indeed it does. I've uploaded a patch with this change.
> Can some of this code be shared with output-ps and moved to
> output-lib.scm?
Potentially. I began by copying (grob-cause...) from
output-ps.scm, but then altered the (ly:format...) bit to be
suitable for svg rather than ps. I suppose that I could abstract
that into a function which is defined in output-ps and output-svg,
then move the rest of the existing (grob-cause ...) into
output-lib.scm. My concern is that this would add complexity;
it's easier to understand a single function rather than spreading
the functionality between a single-order and second-order
functions in two separate source files.
I have no firm opinion on whether that change is worth it; I'm
just raising that possible concern.
- Graham