]> git.donarmstrong.com Git - lilypond.git/commitdiff
Keep buildings which are empty in either axis out of skylines
authorDavid Kastrup <dak@gnu.org>
Sun, 28 Apr 2013 05:20:37 +0000 (07:20 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 26 May 2013 00:33:03 +0000 (02:33 +0200)
lily/skyline.cc

index 31f4c5a1841a9547f2f196dcae2abe17f2132594..5073e69e14b3eaccb805a712e8979be7d9b8856f 100644 (file)
@@ -486,7 +486,8 @@ Skyline::Skyline (vector<Box> const &boxes, Axis horizon_axis, Direction sky)
   sky_ = sky;
 
   for (vsize i = 0; i < boxes.size (); i++)
-    if (!boxes[i].is_empty ())
+    if (!boxes[i].is_empty (X_AXIS)
+        && !boxes[i].is_empty (Y_AXIS))
       buildings.push_front (Building (boxes[i], horizon_axis, sky));
 
   buildings_ = internal_build_skyline (&buildings);
@@ -553,9 +554,12 @@ Skyline::Skyline (vector<Skyline_pair> const &skypairs, Direction sky)
 Skyline::Skyline (Box const &b, Axis horizon_axis, Direction sky)
 {
   sky_ = sky;
-  Building front (b, horizon_axis, sky);
-  single_skyline (front, &buildings_);
-  normalize ();
+  if (!b.is_empty (X_AXIS) && !b.is_empty (Y_AXIS))
+    {
+      Building front (b, horizon_axis, sky);
+      single_skyline (front, &buildings_);
+      normalize ();
+    }
 }
 
 void
@@ -593,7 +597,7 @@ Skyline::insert (Box const &b, Axis a)
     }
 
   /* do the same filtering as in Skyline (vector<Box> const&, etc.) */
-  if (b.is_empty ())
+  if (b.is_empty (X_AXIS) || b.is_empty (Y_AXIS))
     return;
 
   my_bld.splice (my_bld.begin (), buildings_);