]> git.donarmstrong.com Git - lilypond.git/commitdiff
check for cyclic dependencies in pure Y-offset stuff
authorJoe Neeman <joeneeman@gmail.com>
Mon, 2 Jul 2007 21:53:13 +0000 (05:53 +0800)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 2 Jul 2007 21:53:13 +0000 (05:53 +0800)
lily/grob.cc
scm/define-grob-properties.scm
scm/define-grobs.scm

index 495fe2437f97cbddabfb90712d08afbc9c6f3928..34b742e7f576c6de8a5a63252312abd56540cf3b 100644 (file)
@@ -288,16 +288,23 @@ Grob::pure_relative_y_coordinate (Grob const *refp, int start, int end)
   Real off = 0;
 
   if (dim_cache_[Y_AXIS].offset_)
-    off = *dim_cache_[Y_AXIS].offset_;
+    {
+      if (to_boolean (get_property ("pure-Y-offset-in-progress")))
+       programming_error ("cyclic chain in pure-Y-offset callbacks");
+
+      off = *dim_cache_[Y_AXIS].offset_;
+    }
   else
     {
       SCM proc = get_property_data ("Y-offset");
 
       dim_cache_[Y_AXIS].offset_ = new Real (0.0);
+      set_property ("pure-Y-offset-in-progress", SCM_BOOL_T);
       off = robust_scm2double (call_pure_function (proc,
                                                   scm_list_1 (self_scm ()),
                                                   start, end),
                               0.0);
+      del_property ("pure-Y-offset-in-progress");
       delete dim_cache_[Y_AXIS].offset_;
       dim_cache_[Y_AXIS].offset_ = 0;
     }
@@ -625,6 +632,7 @@ ADD_INTERFACE (Grob,
               "outside-staff-horizontal-padding "
               "outside-staff-padding "
               "outside-staff-priority "
+              "pure-Y-offset-in-progress "
               "rotation "
               "springs-and-rods "
               "staff-symbol "
index c4dc73d095125861e600f140a470681898f5c0da..0cdcf8f825739bc423b3ca00501d6364a6a44573 100644 (file)
@@ -637,6 +637,7 @@ where this is set in.")
      (normal-stems ,ly:grob-array? "Array of visible stems.") 
      (note-heads ,ly:grob-array? "List of note head grobs")
      (note-head ,ly:grob? "A single note head")
+     (pure-Y-offset-in-progress ,boolean? "A debugging aid for catching cyclic dependencies.")
      (right-items ,ly:grob-array? "")
      (right-neighbors ,ly:grob-array? "see left-neighbors")
      (separation-item ,ly:grob? "A separation item.")
index d9faba5d708b62241b7c7a088baa3bf7a844435b..2109c8874463e34cb78d83e14b06a342fea5b3aa 100644 (file)
        (direction . ,UP)
        (self-alignment-X . ,CENTER)
        (meta . ((class . Item)
-                (interfaces . (system-start-text-interface
-                               side-position-interface
+                (interfaces . (side-position-interface
                                font-interface))))))
     
     (KeyCancellation
        ;;                       (font-size . -6) (font-name . "sans") (Y-extent . #f)
        (meta . ((class . Paper_column)
                 (interfaces . (paper-column-interface
+                               separation-item-interface
                                axis-group-interface
                                spaceable-grob-interface))))))