lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] 'transparent vs. 'whiteout


From: Marc Hohl
Subject: Re: [Patch] 'transparent vs. 'whiteout
Date: Sat, 19 Jun 2010 17:56:57 +0200
User-agent: Thunderbird 2.0.0.24 (X11/20100317)

Carl Sorensen schrieb:
Marc,

The code looks great to me.  Please email me a patch (so it will have you as
the author) and I will push it.
Here it is.

Thank you,

Marc
Thanks,

Carl


On 6/19/10 3:11 AM, "Marc Hohl" <address@hidden> wrote:

Hello all,

after some discussions on the frog list I created a patch improving the
use of the 'transparent property. As Neil suggested, an invisible grob
should have no whiteout, and this is what the patch does.

After grepping through the code, I don't think that this will influence the
overall use of 'whiteout and 'transparent, but it will make things much
easier
for tablature.

Marc

http://codereview.appspot.com/1681043


_______________________________________________
lilypond-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-devel



>From 486a73e3ac0bd30a3585210e7e6a8593702141e8 Mon Sep 17 00:00:00 2001
From: Marc Hohl <address@hidden>
Date: Sat, 19 Jun 2010 11:02:24 +0200
Subject: [PATCH] Dependency of 'transparent and 'whiteout

If a grob is invisible, the 'whiteout property should not
be taken into account. This will simplify the tablature
handling and doesn't affect the rest.
---
 lily/grob.cc                   |    7 +++++--
 scm/define-grob-properties.scm |    3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lily/grob.cc b/lily/grob.cc
index 2680f55..5d48f27 100644
--- a/lily/grob.cc
+++ b/lily/grob.cc
@@ -123,7 +123,9 @@ Grob::get_print_stencil () const
   if (Stencil *m = unsmob_stencil (stil))
     {
       retval = *m;
-      if (to_boolean (get_property ("transparent")))
+      bool grob_transparent = to_boolean (get_property ("transparent"));
+      
+      if (grob_transparent)
        retval = Stencil (m->extent_box (), SCM_EOL);
       else
        {
@@ -156,7 +158,8 @@ Grob::get_print_stencil () const
        }
 
       /* process whiteout */
-      if (to_boolean (get_property ("whiteout")))
+      /* a grob has to be visible, otherwise the whiteout property has no 
effect */
+      if (!grob_transparent && to_boolean (get_property ("whiteout")))
         {
           /* Call the scheme procedure stencil-whiteout in scm/stencils.scm */
           /* to add a round-filled-box stencil to the stencil list */
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index cfa8726..1ab4562 100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -846,7 +846,8 @@ one below this grob.")
      (when ,ly:moment? "Global time step associated with this column
 happen?")
      (whiteout ,boolean? "If true, the grob is printed over a white
-background to white-out underlying material.  Usually #f by default.")
+background to white-out underlying material, if the grob is visible.
+ Usually #f by default.")
      (width ,ly:dimension? "The width of a grob measured in staff
 space.")
      (word-space ,ly:dimension? "Space to insert between words in
-- 
1.5.4.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]