]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/slur-scoring.cc
Doc-hu: Updated macros for web
[lilypond.git] / lily / slur-scoring.cc
index 5182072a03f9a321413bddb8b632f324c0ed38fb..62eeed5837d15f21342bd01229bc22fe289ab9c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1996--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1996--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -78,18 +78,24 @@ Slur_score_state::~Slur_score_state ()
 }
 
 /*
-  copy slur dir forwards across line break.
+  If a slur is broken across a line break, the direction
+  of the post-break slur must be the same as the pre-break
+  slur.
 */
-void
-Slur_score_state::set_next_direction ()
+Direction
+Slur_score_state::slur_direction () const
 {
-  if (extremes_[RIGHT].note_column_)
-    return;
+  Grob *left_neighbor = slur_->broken_neighbor (LEFT);
 
-  if (Grob *neighbor = slur_->broken_neighbor (RIGHT))
-    {
-      set_grob_direction (neighbor, dir_);
-    }
+  if (left_neighbor && left_neighbor->is_live ())
+    return get_grob_direction (left_neighbor);
+
+  Direction dir = get_grob_direction (slur_);
+
+  if (Grob *right_neighbor = slur_->broken_neighbor (RIGHT))
+    set_grob_direction (right_neighbor, dir);
+
+  return dir;
 }
 
 Encompass_info
@@ -215,7 +221,7 @@ Slur_score_state::fill (Grob *me)
   Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
   thickness_ = robust_scm2double (me->get_property ("thickness"), 1.0) * lt;
 
-  dir_ = get_grob_direction (me);
+  dir_ = slur_direction ();
   parameters_.fill (me);
 
   extract_grob_set (me, "note-columns", columns);
@@ -277,8 +283,6 @@ Slur_score_state::fill (Grob *me)
     = (extremes_[LEFT].stem_ && Stem::get_beam (extremes_[LEFT].stem_))
     || (extremes_[RIGHT].stem_ && Stem::get_beam (extremes_[RIGHT].stem_));
 
-  set_next_direction ();
-
   if (is_broken_)
     musical_dy_ = 0.0;
 }